跳到主要内容

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


image

Create a Space address >> https://gitcode.com/create/space

Note:

  1. You can select multiple "Application Types," which will help you filter your Space applications.
  2. The "Build Methods" are Gradio Build and Static Build; Static build is generally used for static web pages.
  3. 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:

image

Activation Requirements:

  1. Initial activation: Only administrators can activate it.

  2. Guests and non-admin members: Can only go to discussions.

Administrator Activation

Administrators can activate it as follows:

image

Note:

  1. Confirm the "Server Configuration" and "Container Image" again, and select a "Sleep Setting," which defaults to 30 minutes.
  2. Select "Use Current Space Configuration Next Time" to default to selecting this configuration next time you activate or start.
  3. 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:

image

Starting

After the administrator activates, the Space will enter the "Starting" phase, as shown below:

image

Note:

  1. During the starting phase, you can view the K8S container event logs and container running logs (non-administrators cannot view these).
  2. The timeout for starting is 20 minutes. If it exceeds this time, the space will automatically pause.

K8S Container Event Logs

image

  • You can view pod and container creation-related information.

Container Running Logs

image

  • 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:

image

Note:

  1. 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.

image

Associating Datasets

Datasets come from two parts:

  1. Created by yourself
  2. My stars

image

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:

image

  • 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.

image

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


image

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. image

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:
  1. Code errors or corresponding dependencies cannot be downloaded or initialized.
  2. Mismatch between Space server and base image.

If any of the above issues occur, you can troubleshoot by checking the logs.

image

  • 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

image

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


  1. Note that only administrators have deletion permissions. Click "Space Settings," scroll to "Advanced Settings," and click delete.

image

  1. Enter the "Space Path" to delete.

image