Space
GitCode Space allows you to easily host ML demo applications, directly displayed on your personal or team homepage. Whether you're building a personal ML project, showcasing a project to others, or collaborating with developers in the AI ecosystem, GitCode Space is your ideal choice.
Creating a Space
Create a Space address >> https://gitcode.com/create/space
Note:
- You can select multiple "Application Types," which will help you filter your Space applications.
- The "Build Methods" are Gradio Build and Static Build; Static build is generally used for static web pages.
- The "Space Configuration" includes servers and images. Choose different servers and base images based on how you build your Space.
Activating and Starting the Space
After creation, the Space will enter a "Pending Activation" state, as shown below:
Activation Requirements:
-
Initial activation: Only administrators can activate it.
-
Guests and non-admin members: Can only go to discussions.
Administrator Activation
Administrators can activate it as follows:
Note:
- Confirm the "Server Configuration" and "Container Image" again, and select a "Sleep Setting," which defaults to 30 minutes.
- Select "Use Current Space Configuration Next Time" to default to selecting this configuration next time you activate or start.
- If "Nuclear Hours" are insufficient, you cannot click to start immediately.
Guests Go to Discussions
Guests have not activated or administrators have paused, so they can only go to discussions to submit discussions and wait for the space administrator to start, as shown below:
Starting
After the administrator activates, the Space will enter the "Starting" phase, as shown below:
Note:
- During the starting phase, you can view the K8S container event logs and container running logs (non-administrators cannot view these).
- The timeout for starting is 20 minutes. If it exceeds this time, the space will automatically pause.
K8S Container Event Logs
- You can view pod and container creation-related information.
Container Running Logs
- You can view the complete initialization information of the container, image pulling, and error messages;
Completion of Start
After the start is completed, you will be directed to the following page:
Note:
- If the default template is used without any modifications, a Gradio default display page will be shown.
Associating Datasets and Models
A space can only be set while it is paused.
- Enter the "Space Settings" and find the "Association Settings" to set the "models" and "datasets" that the space depends on.
Associating Datasets
Datasets come from two parts:
- Created by yourself
- My stars
Select the corresponding datasets to complete the addition. During the start of the space, they will be automatically downloaded to the dataset
directory, and models will be downloaded to the model
directory, as shown below:
- In the current project's
model
directory + corresponding model name - In the
dataset
directory + dataset name
Pausing the Space
Enter the "Space Settings," find the "Space Management," and you can pause the space.
Pausing the space retains the current container space. When restarted next time, it will directly start the container without recreating and allocating a new one (if resources need to be reallocated, use "Reset Space").
Note: Pausing the Space by an administrator or maintenance personnel will prevent users from accessing it. After pausing, you can reactivate the Space.
Resetting the Space
Resetting the Space deletes the container and creates a new one to rebuild your Space from scratch, reinstalling all dependencies.
Note: It is not recommended to reset the Space unless there is a special situation, as this will cause a slow rebuild and require re-pulling dependencies.
Resource Switching
Need more resources to run, or want to compress the running resources.
Enter the "Space Settings" and find the "Space Resources." You can switch resources according to the required configuration. Switching resources will recreate a new container and rebuild, installing all dependencies.
Startup Failure
- There are several possible reasons for startup failure:
- Code errors or corresponding dependencies cannot be downloaded or initialized.
- Mismatch between Space server and base image.
If any of the above issues occur, you can troubleshoot by checking the logs.
- After resolving the issue, you can retry to restart the Space.
Timing
Running a space consumes the corresponding "nuclear hours," determined by the selected server. CPU cores correspond to "nuclear hours" consumed per hour, such as:
CPU 0.5 core, 60 minutes = 0.5 nuclear hours
CPU 2 cores, 30 minutes = 1 nuclear hour, 60 minutes = 2 nuclear hours
Usage and Storage
The "Usage and Storage" section clearly shows the usage of the current free nuclear hours.
Individual: Individual settings > Usage and Storage
Organization: Organization settings > Usage and Storage
Timing Rules
Timing rules check the space every minute and also detect if the current "nuclear hours" are sufficient. If the timing detects insufficient "nuclear hours," the space will be paused and log records will be made.
Deleting the Space
- Note that only administrators have deletion permissions. Click "Space Settings," scroll to "Advanced Settings," and click delete.
- Enter the "Space Path" to delete.