Publishing

The pd4castr publish command is the final step in the authoring workflow. It registers your model with the pd4castr platform, builds and pushes your Docker image to the private registry, uploads static input files, and optionally triggers the first model run.

What publish does

At a high level, the publish command performs these steps:

  1. Registers (or updates) the model on the pd4castr platform.
  2. Builds and pushes the Docker image to the private container registry.
  3. Uploads any static input files via signed S3 URLs.
  4. Optionally triggers the first model run.

The exact flow depends on whether you’re publishing for the first time or updating an existing model.

First-time publish

When your .pd4castrrc.json doesn’t have a $$id field (or it’s null), the CLI treats this as a new model.

The publish flow for a new model:

  1. The CLI displays a summary of your model configuration and prompts for confirmation.
  2. Unless you pass --skip-checks, the CLI validates your input files and runs pd4castr test internally to verify the container IO contract.
  3. The CLI calls the API to create the model with your full .pd4castrrc.json configuration.
  4. A new model group is created and the revision starts at r0.
  5. The $$id, $$modelGroupID, $$revision, and $$dockerImage fields are written back to your .pd4castrrc.json. Commit these changes to version control.
  6. The CLI fetches Docker registry credentials, builds, tags, and pushes your container image.
  7. If your model has static inputs, the CLI uploads them via signed S3 URLs.
  8. Unless you pass --skip-trigger, the CLI triggers the first model run.

Updating an existing model

When your .pd4castrrc.json already has a $$id set, the CLI detects that the model has been published before and prompts you to choose between two options:

  • New revision (r0 to r1, r1 to r2, and so on) — Creates a new model entry in the same model group with an incremented revision number. Previous revisions remain available in the pd4castr UI.
  • Update existing revision — Mutates the current revision in place. Historical data is preserved but will no longer display in the pd4castr UI.

Both paths validate that your local $$revision and $$modelGroupID match the published state on the API, so you’ll get an error if your config is out of sync. After validation, the flow continues with the same build, push, upload, and trigger steps as a first-time publish.

Publish command flags

FlagDefaultDescription
-i, --input-dirtest_inputDirectory containing input files.
-p, --port9800Port for the IO testing web server.
--skip-checks (--sc)falseSkip Docker build and IO validation.
--skip-trigger (--st)falseSkip triggering a run after publish.
-c, --config.pd4castrrc.jsonPath to the config file.

After publishing

Once your model is published:

  • Open pdView to see your model’s first run results (if a run was triggered).
  • If your model uses AUTOMATIC run mode, it will now run automatically whenever all required input data arrives. See Run modes and scheduling for details.
  • Use the publisher tools in pdView to monitor run status and manage your model.

Next steps