Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrates GitLab Runner into DTaaS #1082

Draft
wants to merge 12 commits into
base: feature/distributed-demo
Choose a base branch
from

Conversation

aryanpingle
Copy link
Contributor

Integrates GitLab Runner into DTaaS

Addresses #892 by integrating a GitLab Runner setup into the DTaaS software.

Type of Change

✔ New feature
✔ Documentation update

Description

Adds a compose.runner.yml file that spins up a Docker container running the gitlab/gitlab-runner image, and automatically starts a gitlab runner based on the settings in config.toml.

Testing

Tested using a localhost and a server installation, both using a server-hosted gitlab instance.

Impact

The process of registering a GitLab Runner will be greatly simplified. Developers will be able to use the digital twins preview page with a self-hosted runner.

Additional Information

  • On localhost, the hello-world digital twin fails during execution as the runner executor cannot access the host machine's localhost.
  • Currently, network_mode is set to host for the gitlab-runner container. This should instead use or create a docker network.
  • Added a guide in the services/gitlab directory.
  • Need to update/create the admin guide for using the Digital Twins Preview Page.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have added tests for all the new code and any changes made to
    existing code.
  • I have made corresponding changes to the documentation.

Copy link
Contributor

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aryanpingle Thanks for the PR. Please see the comments.

deploy/services/gitlab/compose.runner.yml Outdated Show resolved Hide resolved
token = "xxx"
executor = "docker"
[runners.docker]
tls_verify = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this solve the problem of self-generated certificates?

deploy/services/gitlab/GITLAB-RUNNER.md Outdated Show resolved Hide resolved
@aryanpingle
Copy link
Contributor Author

The gitlab-runner container is built on the gitlab/gitlab-runner image using alpine and contains the gitlab-runner executable. Starting the container executes gitlab-runner register and gitlab-runner start automatically, so we only need to deal with the runner-config.toml file to set things up.

The gitlab/gitlab-runner image uses a custom image of its own, from the "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper" repository. This uses the docker engine to spawn a sibling container to gitlab-runner, which actually executes the CI/CD job.

Now, if you try using docker ps you won't see the sibling executor container/s, for a reason I don't fully understand. Here's a link to the SO answer: https://stackoverflow.com/a/41994792/8089674.

@aryanpingle aryanpingle force-pushed the feature/integrated-runner branch from a583833 to 721271f Compare December 10, 2024 11:59
@prasadtalasila
Copy link
Contributor

@aryanpingle A related correction in the docs

line-69 of deploy/services/gitlab/INTEGRATION.md file should be:

If the DTaaS application is hosted at https://foo.com/, then configure the following files:

1. Localhost Installation - You are using the integrated runner locally with
a GitLab instance hosted at `https://localhost/gitlab`.
2. Server Installation - You are using the integrated runner with a GitLab
instance hosted on a production server. This server may be a remote server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(https://localhost/gitlab)

@prasadtalasila
Copy link
Contributor

The gitlab-runner container is built on the gitlab/gitlab-runner image using alpine and contains the gitlab-runner executable. Starting the container executes gitlab-runner register and gitlab-runner start automatically, so we only need to deal with the runner-config.toml file to set things up.

The gitlab/gitlab-runner image uses a custom image of its own, from the "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper" repository. This uses the docker engine to spawn a sibling container to gitlab-runner, which actually executes the CI/CD job.

Now, if you try using docker ps you won't see the sibling executor container/s, for a reason I don't fully understand. Here's a link to the SO answer: https://stackoverflow.com/a/41994792/8089674.

please add this information in a separate section at the end of GITLAB-RUNNER.md

@prasadtalasila prasadtalasila added this to the Release v0.7.0 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants