-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Adds integrated gitlab runner to all installation scenarios. It is now possible to have one runner that can run all the jobs sent by DevOps requests. - Updates DevOps documentation and ports corrections from documentation of release v0.6.0 --------- Co-authored-by: aryanpingle <[email protected]>
- Loading branch information
1 parent
0f127e7
commit 2257ef5
Showing
49 changed files
with
1,204 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it as below." | ||
authors: | ||
- family-names: "Talasila" | ||
given-names: "Prasad" | ||
orcid: "https://orcid.org/0000-0002-8973-2640" | ||
title: "Digital Twin as a Service" | ||
version: 0.3.0 | ||
date-released: 2023-11-08 | ||
version: 0.6.0 | ||
date-released: 2024-11-11 | ||
url: "https://github.com/into-cps-association/DTaaS" | ||
message: Please cite the following works when using this software. | ||
preferred-citation: | ||
conference: "The 2023 IEEE International Conference on Digital Twin" | ||
authors: | ||
- family-names: "Talasila" | ||
given-names: "Prasad" | ||
orcid: "https://orcid.org/0000-0002-8973-2640" | ||
- family-names: "Gomes" | ||
given-names: "Cláudio" | ||
orcid: "https://orcid.org/0000-0000-0000-0000" | ||
- family-names: "Mikkelsen" | ||
given-names: "Peter Høgh" | ||
orcid: "https://orcid.org/0000-0003-2321-758X" | ||
- family-names: "Gil" | ||
given-names: "Santiago" | ||
orcid: "https://orcid.org/0000-0002-1789-531X" | ||
- family-names: "Kamburjan" | ||
given-names: "Eduard" | ||
orcid: "https://orcid.org/0000-0002-0996-2543" | ||
- family-names: "Larsen" | ||
given-names: "Peter Gorm" | ||
orcid: "https://orcid.org/0000-0002-4589-1500" | ||
title: "Digital Twin as a Service (DTaaS): A Platform for Digital Twin Developers and Users" | ||
month: 8 | ||
year: 2023 | ||
- family-names: Talasila | ||
given-names: Prasad | ||
- family-names: Gomes | ||
given-names: Cláudio | ||
- family-names: Vosteen | ||
given-names: Lars B | ||
- family-names: Iven | ||
given-names: Hannes | ||
- family-names: Leucker | ||
given-names: Martin | ||
- family-names: Gil | ||
given-names: Santiago | ||
- family-names: Mikkelsen | ||
given-names: Peter H | ||
- family-names: Kamburjan | ||
given-names: Eduard | ||
- family-names: Larsen | ||
given-names: Peter G | ||
doi: 10.1177/00375497241298653 | ||
identifiers: | ||
- type: doi | ||
value: 10.1177/00375497241298653 | ||
title: Composable digital twins on Digital Twin as a Service platform | ||
date-published: 2024-01-01 | ||
year: 2024 | ||
journal: SIMULATION | ||
publisher: | ||
name: 'SAGE Publications Sage UK: London, England' | ||
start: '00375497241298653' | ||
type: article |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
GITLAB_HOME='/Users/<Username>/DTaaS/deploy/services/gitlab' | ||
DTAAS_DIR='/Users/<username>/DTaaS' | ||
SERVER_DNS='foo.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
# GitLab Runner Integration | ||
|
||
This document outlines the steps needed to create a Docker container named | ||
`gitlab-runner` which will contain a single runner that will be responsible for | ||
the execution of Digital Twins. There are two installation scenarios: | ||
|
||
1. __Localhost Installation__ - You are using the integrated runner locally with | ||
a GitLab instance hosted at `https://localhost/gitlab`. | ||
1. __Server Installation__ - You are using the integrated runner with a GitLab | ||
instance hosted on a production server. This server may be a remote server | ||
and not necessarily your own, and may have TLS enabled with a self-signed | ||
certificate. | ||
|
||
Following the steps below sets up the integrated runner which can be used to | ||
execute digital twins from the Digital Twins Preview Page. | ||
|
||
## Prerequisites | ||
|
||
A GitLab Runner picks up CI/CD jobs by communicating with a GitLab instance. | ||
For an explanation of how to set up a GitLab instance that integrates with a | ||
DTaaS application, refer to [our GitLab instance document](../gitlab/README.md) | ||
and [our GitLab integration guide](../gitlab/INTEGRATION.md). | ||
|
||
The rest of this document assumes you have a running DTaaS application with a | ||
GitLab instance running. | ||
|
||
## Runner Scopes | ||
|
||
A GitLab Runner can be configured for three different scopes: | ||
|
||
| Runner Scope | Description | | ||
|-----------------|-------------| | ||
| Instance Runner | Available to all groups and projects in a GitLab instance. | | ||
| Group Runner | Available to all projects and subgroups in a group. | | ||
| Project Runner | Associated with one specific project. | | ||
|
||
We suggest creating __instance runners__ as they are the most straightforward, but | ||
any type will work. More about these three types can be found on | ||
[the official GitLab documentation page](https://docs.gitlab.com/ee/ci/runners/runners_scope.html). | ||
|
||
## Obtaining A Registration Token | ||
|
||
First, we will obtain the token necessary to register the runner for the GitLab | ||
instance. Open your GitLab instance (remote or local) and depending on your | ||
choice of runner scope, follow the steps given below: | ||
|
||
| Runner Scope | Steps | | ||
|-----------------|-------| | ||
| Instance Runner |1. On the __Admin__ dashboard, navigate to __CI/CD > Runners__.<br>2. Select __New instance runner__.| | ||
| Group Runner |1. On the __DTaaS__ group page, navigate to __Settings > CI/CD > Runners__.<br>2. Ensure the __Enable shared runners for this group__ option is enabled.<br>3. On the __DTaaS__ group page, navigate to __Build > Runners__.<br>4. Select __New group runner__.| | ||
| Project Runner |1. On the __DTaaS__ group page, select the project named after your GitLab username.<br>2. Navigate to __Settings > CI/CD > Runners__.<br>3. Select __New project runner__.| | ||
|
||
For any scope you have chosen, you will be directed to a page to create a | ||
runner: | ||
|
||
1. Under __Platform__, select the Linux operating system. | ||
1. Under __Tags__, add a `linux` tag. | ||
1. Select __Create runner__. | ||
|
||
You should then see the following screen: | ||
|
||
![Runner Registration Screen](./runner-registration.png) | ||
|
||
Be sure to save the generated runner authentication token. | ||
|
||
## Configuring the Runner | ||
|
||
Depending on your installation scenario, the runner setup reads certain | ||
configurations settings: | ||
|
||
1. __Localhost Installation__ - uses `deploy/docker/.env.local` | ||
1. __Server Installation__ - uses `deploy/docker/.env.server` | ||
|
||
These files are integral to running the DTaaS application, so it will be | ||
assumed that you have already configured these. | ||
|
||
We need to register the runner with the GitLab instance so that they may | ||
communicate with each other. `deploy/services/runner/runner-config.toml` | ||
has the following template: | ||
|
||
```toml | ||
[[runners]] | ||
name = "dtaas-runner-1" | ||
url = "https://foo.com/gitlab/" # Edit this | ||
token = "xxx" # Edit this | ||
executor = "docker" | ||
[runners.docker] | ||
tls_verify = false | ||
image = "ruby:2.7" | ||
privileged = false | ||
disable_entrypoint_overwrite = false | ||
oom_kill_disable = false | ||
volumes = ["/cache"] | ||
network_mode = "host" # Disable this in secure contexts | ||
``` | ||
|
||
1. Set the `url` variable to the URL of your GitLab instance. | ||
1. Set the `token` variable to the runner registration token you obtained earlier. | ||
1. If you are following the server installation scenario, remove the line | ||
`network_mode = "host"`. | ||
|
||
A list of advanced configuration options is provided on the | ||
[GitLab documentation page](https://docs.gitlab.com/runner/configuration/advanced-configuration.html). | ||
|
||
## Start the GitLab Runner | ||
|
||
You may use the following commands to start and stop the `gitlab-runner` | ||
container respectively, depending on your installation scenario: | ||
|
||
1. Localhost Installation | ||
|
||
```bash | ||
docker compose -f deploy/services/runner/compose.runner.local.yml --env-file deploy/docker/.env.local up -d | ||
docker compose -f deploy/services/runner/compose.runner.local.yml --env-file deploy/docker/.env.local down | ||
``` | ||
|
||
1. Server Installation | ||
|
||
```bash | ||
docker compose -f deploy/services/runner/compose.runner.server.yml --env-file deploy/docker/.env.server up -d | ||
docker compose -f deploy/services/runner/compose.runner.server.yml --env-file deploy/docker/.env.server down | ||
``` | ||
|
||
Once the container starts, the runner within it will run automatically. You can | ||
tell if the runner is up and running by navigating to the page where | ||
you created the runner. For example, an Instance Runner would look like this: | ||
|
||
![Status indicator under Admin Area > Runners](./runner-activation.png) | ||
|
||
You will now have a GitLab runner ready to accept jobs for the GitLab instance. | ||
|
||
## Advanced: Runner Executor | ||
|
||
The term `runner` could refer one of two things: | ||
|
||
1. The `gitlab-runner` Container | ||
This is the Docker container that is created when you execute the commands | ||
given above. It is based on the `gitlab/gitlab-runner:alpine` image, and is | ||
used to spawn one or more _executors_ that actually execute the CI/CD jobs. | ||
|
||
These executors are spawned using a packaged version of Docker within the | ||
`gitlab-runner` image. | ||
1. The Runner Executor | ||
These are agents spawned by the `gitlab-runner` container, not as children | ||
but as __siblings__ of the container. These runner executors will not show up | ||
on running commands such as `docker ps`, but you can check their status by | ||
running `gitlab-runner status` inside the `gitlab-runner` container. | ||
|
||
Keeping this distinction in mind is important, as the GitLab documentation | ||
sometimes uses them interchangeably. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Environment variables taken from deploy/docker/.env.local | ||
|
||
services: | ||
gitlab-runner: | ||
container_name: gitlab-runner | ||
# Runner image version is independent of the gitlab-ce image version | ||
image: gitlab/gitlab-runner:alpine-v17.5.3 | ||
volumes: | ||
- "./runner-config.toml:/etc/gitlab-runner/config.toml:ro" | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
# Maps the self-signed certificate for localhost to the container | ||
- "${DTAAS_DIR}/deploy/docker/certs/localhost/fullchain.pem:/etc/gitlab-runner/certs/localhost.crt:ro" | ||
|
||
# To make https://localhost accessible from the container | ||
network_mode: host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Environment variables taken from deploy/docker/.env.server | ||
|
||
services: | ||
gitlab-runner: | ||
container_name: gitlab-runner | ||
# Runner image version is independent of the gitlab-ce image version | ||
image: gitlab/gitlab-runner:alpine-v17.5.3 | ||
volumes: | ||
- "./runner-config.toml:/etc/gitlab-runner/config.toml:ro" | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
# Maps the self-signed certificate for your server to the container | ||
# Remove this if you are not using a self-signed certificate | ||
- "${DTAAS_DIR}/deploy/docker/certs/${SERVER_DNS}/fullchain.pem:/etc/gitlab-runner/certs/${SERVER_DNS}.crt:ro" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[runners]] | ||
name = "dtaas-runner-1" | ||
url = "https://foo.com/gitlab/" # Edit this | ||
token = "xxx" # Edit this | ||
executor = "docker" | ||
[runners.docker] | ||
tls_verify = false | ||
image = "ruby:2.7" | ||
privileged = false | ||
disable_entrypoint_overwrite = false | ||
oom_kill_disable = false | ||
volumes = ["/cache"] | ||
network_mode = "host" # Disable this in secure contexts |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.