How to migrate from command to startup command and arguments
The Serverless Jobs v1alpha2 API introduces a new startup execution mechanism based on commands and arguments, replacing the legacy command.
The Scaleway console allows you to quickly and easily migrate your existing jobs to the new system.
Migration from command field to startup_command field is mostly transparent for customers using Scaleway Console but can require some attention of API, CLI and other devtools users.
The change allows for:
- More customization for executing complex commands, by separating
startup_commandandargs. - Better alignment with our underlying Kubernetes implementation.
- The ability to compute environment variables used in command and argument strings.
startup_commandis now an array of commands instead of a single string.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An existing job that uses the legacy command field
How to migrate from command to startup commands and arguments
-
Click Jobs in the Serverless section of the side menu. The jobs page displays.
-
Click the name of the job you want to manage, then click the Settings tab.
-
Scroll down to the Configure advanced options, then click the Execution tab.
-
Click the Upgrade button. A pop-up displays.
-
Split your existing startup command into a command (which corresponds to the
ENTRYPOINTDocker instruction), and arguments (which correspond to theCMDDocker instruction). -
Click Upgrade to the new format to finish.
Your Serverless Job now uses the command and arguments mechanism.
Migration examples
Simple command
Legacy command
sleep 60sCorresponding command and arguments
startup_command: [sleep]
args: [60s]Complex command
Legacy command
/app/migrate up --database "$DB_URL" --password "$DB_PASSWORD" --port 3002Corresponding command and arguments
startup_command: [/app/migrate]
args: [up, --database, "$(DB_URL)", --password, "$(DB_PASSWORD)", --port, 3002]