Skip to main content

Launch Processes on Instance Startup

On the GPUGEEK platform, this feature allows you to automatically start processes or tasks when the instance boots. It is mainly suitable for the following scenarios:

  1. Automatically starting the required process when the instance powers on.
  2. Inference tasks, e.g., when scaling up a function node, simply creating an instance automatically starts the inference task to receive requests.
  3. Specific web projects, such as Stable Diffusion web UI.
  4. Job-based tasks: start the instance, run the job, then use the platform’s scheduled shutdown feature to power off once the task is finished.
  5. Specific training or monitoring tasks.

This feature requires specifying the command to run when creating the instance.

Examples of Using This Feature
  1. Start a built-in project in the official image on instance startup.
  2. Start a training project on instance startup.
  3. Start an inference project on instance startup.
  4. Start a script on instance startup that launches multiple projects.
  5. Start a web project on instance startup and make it publicly accessible.

1. Start a Built-In Project in the Official Image

Go to the GPUGEEK Console to create an instance.
Select the instance image → expand Advanced Configuration → fill in the entry command.
The entry command is executed as the task when the instance starts. Here we choose an official image.

python -m http.server 8080

Click Create Instance after selecting.

2. Log in to the Instance

  • Via the console, click JupyterLab for the instance and open a terminal.
  • Or log in via SSH.

3. Verify if the Process Started

Run ps aux | grep [process name] to check.

warning

Once verified, every startup of this instance will automatically run python -m http.server 8080.
If the task fails, it won’t affect the normal startup of the instance.


2. Start a Training Project

tip

By default, the official image does not contain your training project. The correct procedure:

  1. Use the official image to create an instance.
  2. Enter the instance and prepare training code.
  3. Shut down the instance → Instance Management → More → Backup Image.
  4. Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the training task to start.
  5. Create instance → verify training starts.

3. Start an Inference Project

tip

By default, the official image does not contain your inference project. The correct procedure:

  1. Use the official image to create an instance.
  2. Enter the instance, prepare your inference project and data. If no cloud drive is available in the datacenter, store data on the system disk.
  3. Shut down the instance → Instance Management → More → Backup Image.
  4. Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the inference task to start.
  5. Create instance → verify inference starts.

4. Start a Script to Launch Multiple Projects

tip

By default, the official image does not contain your script. The correct procedure:

  1. Use the official image to create an instance.
  2. Enter the instance, prepare the script and tasks it needs to launch. If multiple tasks must run, ensure all but the last one run with nohup in the background.
  3. Shut down the instance → Instance Management → More → Backup Image.
  4. Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the script to run.
  5. Create instance → verify the script and its tasks launched.

5. Start a Web Project

tip

By default, the official image does not contain your web project. The correct procedure:

  1. Use the official image to create an instance.
  2. Enter the instance, prepare the web project, manually test if it can start correctly.
  3. Shut down the instance → Instance Management → More → Backup Image.
  4. Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the web project to run.
  5. Create instance → verify the web project starts.