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 triggers a 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 every configured input file. Each top-level file and each file entry of an input’s sources gets its own upload.
  4. Triggers a model run.

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

First-Time Publish

The publish flow for a new model:

  1. The CLI displays a summary of your model configuration and prompts for confirmation.
  2. The CLI validates your input files and runs pd4castr test internally to verify the model IO contract. When an input, or an input’s default source, uses a data fetcher, run pd4castr fetch before you publish. Validation fails until the fetched file is in test_input/.
  3. The CLI creates your model on the platform with your full .pd4castrrc.json configuration.
  4. A new model group is created and the revision starts at r0.
  5. The CLI pushes your model’s Docker image to a private container registry scoped to your organisation.
  6. If your model has configured input files, the CLI uploads them to the platform. Each top-level file and each file entry of an input’s sources gets its own upload.
  7. Unless you pass --skip-trigger, the CLI triggers the first model run. On a model with a source-binding axis, it triggers the default source.

If an upload fails partway through step 6, the CLI lists what it already uploaded in that run and asks you to re-run pd4castr publish, which uploads every input again from the start.

Updating an Existing Model

When your model has already been published, the publish flow will prompt 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 — Updates the current revision in place. See What an in-place update does to existing runs for what this means for runs you’ve already seen in the pd4castr UI.

After choosing an option, the flow continues with the same build, push, upload, and trigger steps as a first-time publish.

What an In-Place Update Does to Existing Runs

Updating a revision in place queues a model run the same way any other on-demand trigger does: with the latest file available for each input, not the files a past run used. The queued run’s run datetime is the time it was queued, unless the model’s config sets a run datetime query, in which case the platform recomputes the run datetime from that run’s own prepared input files, before the model container starts.

When the model’s run datetime query derives its value from input data that hasn’t changed since an earlier run, the new run gets that earlier run’s exact run datetime. The pd4castr UI’s run history and latest-run views group runs by run datetime and keep only the most recently created run in each group, so there the newer run displaces the earlier one at that datetime. A plain list of a model’s runs is not deduplicated this way: it returns every run ordered by creation time, so both the earlier run and the newer one sharing its run datetime appear.

Non-Interactive Mode

For non-interactive environments (CI pipelines, scripts, etc.), use --non-interactive to skip all confirmation prompts. When publishing a new model (no $$id in the config), no extra flags are needed:

pd4castr publish --config .pd4castrrc.json --non-interactive

When publishing an existing model, you must also specify --publish-action to tell the CLI which path to take:

# update the current revision in place
pd4castr publish --config .pd4castrrc.json --non-interactive --publish-action=update
 
# create a new revision
pd4castr publish --config .pd4castrrc.json --non-interactive --publish-action=new-revision

The CLI errors if --publish-action is omitted for an existing model in non-interactive mode.

Publish Command Flags

The following flags are available for the pd4castr publish command:

FlagDefaultDescription
-c, --config.pd4castrrc.jsonPath to the config file.
-p, --port9800Port for the IO testing web server.
--skip-trigger (--st)falseSkip triggering a model run after publish.
--non-interactivefalseSkip all confirmation prompts.
--publish-actionAction for existing models: update or new-revision. Required with --non-interactive.

After Publishing

Once your model is live, you can verify and configure it.

  • Open the pd4castr UI 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 Author dashboard to monitor run status and manage your model.

Next Steps