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:
- Automatically starting the required process when the instance powers on.
- Inference tasks, e.g., when scaling up a function node, simply creating an instance automatically starts the inference task to receive requests.
- Specific web projects, such as
Stable Diffusion web UI
. - 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.
- Specific training or monitoring tasks.
This feature requires specifying the command to run when creating the instance.
- Start a built-in project in the official image on instance startup.
- Start a training project on instance startup.
- Start an inference project on instance startup.
- Start a script on instance startup that launches multiple projects.
- 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.
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
By default, the official image does not contain your training project. The correct procedure:
- Use the official image to create an instance.
- Enter the instance and prepare training code.
- Shut down the instance → Instance Management → More → Backup Image.
- Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the training task to start.
- Create instance → verify training starts.
3. Start an Inference Project
By default, the official image does not contain your inference project. The correct procedure:
- Use the official image to create an instance.
- Enter the instance, prepare your inference project and data. If no cloud drive is available in the datacenter, store data on the system disk.
- Shut down the instance → Instance Management → More → Backup Image.
- Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the inference task to start.
- Create instance → verify inference starts.
4. Start a Script to Launch Multiple Projects
By default, the official image does not contain your script. The correct procedure:
- Use the official image to create an instance.
- 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. - Shut down the instance → Instance Management → More → Backup Image.
- Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the script to run.
- Create instance → verify the script and its tasks launched.
5. Start a Web Project
By default, the official image does not contain your web project. The correct procedure:
- Use the official image to create an instance.
- Enter the instance, prepare the web project, manually test if it can start correctly.
- Shut down the instance → Instance Management → More → Backup Image.
- Use the backup image to create a new instance → Advanced Configuration → Entry Command → specify the web project to run.
- Create instance → verify the web project starts.