Commit b6639d1e authored by Paul Bethge's avatar Paul Bethge
Browse files

add explanation

parent 13aee89b
Pipeline #173 canceled with stage
#### Minimal CPU Job
# Requirements
This feature is only available to projects or groups within the "GPU Server" group.
In order to run a pipeline you have to be `Maintainer` or `Owner` of the project.
### Enable CI/CD pipeline
To enable or disable GitLab CI/CD pipelines in your project:
1. On the left sidebar, select Settings > General.
2. Expand Visibility, project features, permissions.
3. In the Repository section, turn on or off Pipelines as required.
## Submitting a CPU Job
You can use the CI/CD pipeline to submit a job that gets picked up by a GitLab Runner and is executed in a container on our AI Server. To view available runners, go to `Settings` > `CI/CD` and expand `Runners`.
In order to specify a job and its environment you need to have the `.gitlab-ci.yml` in the top-level of your repository.
The pipeline runs every time changes are pushed to any branch in the project.
## Minimal CPU Job
```yaml
my-first-job:
image: ubuntu:18.04
......@@ -10,47 +24,51 @@ my-first-job:
- cpu
```
#### other useful constraints
- stage
- only
- parallel
- resource_group
- services
### Required
- Maintainer or Owner role for the project
- the .gitlab-ci.yml in the root of your repo
When you commit the file to your repository, the runner runs your jobs. The job results are displayed in a pipeline.
To view available runners:
Go to Settings > CI/CD and expand Runners.
## the CI file
The scripts are grouped into jobs, and jobs run as part of a larger pipeline. You can group multiple independent jobs into stages that run in a defined order. The CI/CD configuration needs at least one job that is not hidden. The pipeline runs every time changes are pushed to any branch in the project.
### Explanation
#### Jobs
In this file, you define the structure and order of jobs that the runner should execute.
Jobs are defined as entries at the top-level, here: `my-first-job`.
Those entries contain constraints stating under what conditions the job should be executed.
Scripts may contain multiple jobs, and jobs run as part of a larger pipeline.
Imagine the scripts you add to jobs are the same as CLI commands you run on your computer.
In this file, you define:
- The structure and order of jobs that the runner should execute.
- The decisions the runner should make when specific conditions are encountered.
#### Docker Images
For our purposes, we make use of docker images. They are specified with the `image` constraint. Images are snapshots of environments such as the system your currently working on. You can build them yourself or use prebuild images, e.g. from [docker hub](https://hub.docker.com/). The runner will spawn an instance of this image and you can use or modify it by running scripts and executables, like `apt update && apt upgrade`. After your job is done the container will be deleted.
#### Jobs
- Defined with constraints stating under what conditions they should be executed.
- Top-level elements with an arbitrary name and must contain at least the script clause.
- Not limited in how many can be defined.
#### Scripts
With the `script` constraint you can run any executable that is available in either the container or the repository. A Job has to have at least on item in script.
```yaml
job1:
script: "execute-script-for-job1"
#### Tags
Using the `tags` constraint we define which Runner will be chosen to run your code.
job2:
script: "execute-script-for-job2"
##### CPU Runner
```yaml
tags:
- docker
- cpu
```
##### GPU Runner
```yaml
tags:
- docker
- gpu
```
#### View the state of the pipeline
#### other useful constraints
check the usage of additional constraints in the [reference guide](https://docs.gitlab.com/ee/ci/yaml/index.html)
- _stage_:
You can group multiple independent jobs into stages that run in a defined order.
- only
- parallel
- resource_group
- services
## Further Reading
- check syntax in the [reference guide](https://docs.gitlab.com/ee/ci/yaml/index.html)
\ No newline at end of file
- https://docs.gitlab.com/ee/ci/
## Notes
Please be mindful of the resources you use. For complex or long running jobs we recommend triggering your training or other pipelines manually so that you only use the ressource wenn actually needed. Use the CPU runner(s) if no GPU access is required.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment