Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GitLab Runner As Code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Foundation
IT
Releng
GitLab Runner Service
GitLab Runner As Code
Merge requests
!6
feat: test fast runner on MR
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat: test fast runner on MR
feat/fastdraft
into
main
Overview
0
Commits
14
Pipelines
19
Changes
8
Merged
Sébastien Heurtematte
requested to merge
feat/fastdraft
into
main
2 years ago
Overview
0
Commits
14
Pipelines
19
Changes
8
Expand
0
0
Merge request reports
Compare
main
version 13
be6bc3f9
2 years ago
version 12
018a0a0c
2 years ago
version 11
d23b6915
2 years ago
version 10
84332ea4
2 years ago
version 9
d7c27fcc
2 years ago
version 8
9ca6526b
2 years ago
version 7
23711950
2 years ago
version 6
1baae158
2 years ago
version 5
7a088bdd
2 years ago
version 4
52251270
2 years ago
version 3
5fac4538
2 years ago
version 2
66d54b6d
2 years ago
version 1
2d20df42
2 years ago
main (base)
and
latest version
latest version
b28e696b
14 commits,
2 years ago
version 13
be6bc3f9
13 commits,
2 years ago
version 12
018a0a0c
12 commits,
2 years ago
version 11
d23b6915
11 commits,
2 years ago
version 10
84332ea4
10 commits,
2 years ago
version 9
d7c27fcc
9 commits,
2 years ago
version 8
9ca6526b
8 commits,
2 years ago
version 7
23711950
7 commits,
2 years ago
version 6
1baae158
6 commits,
2 years ago
version 5
7a088bdd
5 commits,
2 years ago
version 4
52251270
4 commits,
2 years ago
version 3
5fac4538
3 commits,
2 years ago
version 2
66d54b6d
2 commits,
2 years ago
version 1
2d20df42
1 commit,
2 years ago
8 files
+
899
−
20
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
instances/eclipsefdn.it.releng.gitlab-runner-as-code/okd-c1/target/k8s/configmap-fastdraft.yaml
0 → 100644
+
141
−
0
Options
#*******************************************************************************
# Copyright (c) 2022 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html,
# or the MIT License which is available at https://opensource.org/licenses/MIT.
# SPDX-License-Identifier: EPL-2.0 OR MIT
#*******************************************************************************
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
annotations
:
org.eclipse.cbi.ef-grac/project.fullname
:
'
eclipsefdn.it.releng.gitlab-runner-as-code'
org.eclipse.cbi.ef-grac/project.shortname
:
'
gitlab-runner-as-code'
org.eclipse.cbi.ef-grac/project.namespace
:
'
eclipsefdn.it.releng'
namespace
:
'
ef-grac-eclipsefdn-it-releng-gitlab-runner-as-code'
name
:
ef-grac-eclipsefdn-it-releng-gitlab-runner-as-code-fastdraft-cm
data
:
entrypoint
:
|
#!/bin/bash
set -e
[[ "$REGISTER_DEBUG" == "true" ]] && set -x
mkdir -p /home/gitlab-runner/.gitlab-runner/
cp /configmaps/config.toml /home/gitlab-runner/.gitlab-runner/
# Set up environment variables for cache
if [[ -f /secrets/accesskey && -f /secrets/secretkey ]]; then
export CACHE_S3_ACCESS_KEY=$(cat /secrets/accesskey)
export CACHE_S3_SECRET_KEY=$(cat /secrets/secretkey)
fi
if [[ -z "${REGISTRATION_TOKEN}" ]] && [[ -f /secrets/runner-registration-token ]]; then
export REGISTRATION_TOKEN=$(cat /secrets/runner-registration-token)
fi
# should use api : https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner
#if [[ -z "${CI_SERVER_TOKEN}" ]] && [[ -f /secrets/runner-token ]]; then
# export CI_SERVER_TOKEN=$(cat /secrets/runner-token)
#fi
# Validate this also at runtime in case the user has set a custom secret
#if [[ ! -z "$CI_SERVER_TOKEN" && "1" -ne "1" ]]; then
# echo "Using a runner token with more than 1 replica is not supported."
# exit 1
#fi
# Register the runner
if ! sh /configmaps/register-the-runner; then
exit 1
fi
# Run pre-entrypoint-script
if ! bash /configmaps/pre-entrypoint-script; then
exit 1
fi
# Start the runner
exec /entrypoint run --user=gitlab-runner \
--working-directory=/home/gitlab-runner
config.toml
:
|
concurrent = 4
check_interval = 10
sentry_dsn = ""
config.template.toml
:
|
[[runners]]
environment = [
"TMPDIR=$CI_PROJECT_DIR.tmp",
"HOME=$CI_BUILDS_DIR",
"CI_RUNNER_PERSISTENT_STORAGE=/var/shared",
]
[runners.kubernetes]
[runners.kubernetes.pod_labels]
"gitlab/project_name"="${CI_PROJECT_NAME}"
"gitlab/project_path"="${CI_PROJECT_PATH_SLUG}"
[runners.kubernetes.pod_annotations]
"gitlab/branch_name"="${CI_BRANCH_NAME}"
"gitlab/commit_author"="${CI_COMMIT_AUTHOR}"
"gitlab/environment_name"="${CI_ENVIRONMENT_NAME}"
"gitlab/environment_slug"="${CI_ENVIRONMENT_SLUG}"
"gitlab/environment_tier"="${CI_ENVIRONMENT_TIER}"
"gitlab/job_author"="${GITLAB_USER_NAME}"
"gitlab/job_id"="${CI_JOB_ID}"
"gitlab/job_image"="${CI_JOB_IMAGE}"
"gitlab/job_name"="${CI_JOB_NAME}"
"gitlab/job_url"="$CI_JOB_URL"
"gitlab/pipeline_id"="${CI_PIPELINE_ID}"
"gitlab/pipeline_iid"="${CI_PIPELINE_IID}"
"gitlab/project_name"="${CI_PROJECT_NAME}"
"gitlab/project_path"="${CI_PROJECT_PATH_SLUG}"
"gitlab/runner_version"="${CI_RUNNER_VERSION}"
"gitlab/stage_name"="${CI_JOB_STAGE}"
"pod-cleanup.gitlab.com/ttl"="6h"
[[runners.kubernetes.volumes.pvc]]
name = "ef-grac-eclipsefdn-it-releng-gitlab-runner-as-code-nfs-pvc"
mount_path = "/var/shared"
[[runners.kubernetes.volumes.empty_dir]]
name = "repo"
mount_path = "/builds"
medium = "Memory"
register-the-runner
:
|
#!/bin/bash
[[ "$REGISTER_DEBUG" == "true" ]] && set -x
MAX_REGISTER_ATTEMPTS=30
for i in $(seq 1 "${MAX_REGISTER_ATTEMPTS}"); do
echo "Registration attempt ${i} of ${MAX_REGISTER_ATTEMPTS}"
/entrypoint register
retval=$?
if [ ${retval} = 0 ]; then
break
elif [ ${i} = ${MAX_REGISTER_ATTEMPTS} ]; then
exit 1
fi
sleep 5
done
exit 0
check-live
:
|
#!/bin/bash
if /usr/bin/pgrep -f .*register-the-runner; then
exit 0
elif /usr/bin/pgrep gitlab.*runner; then
exit 0
else
exit 1
fi
pre-entrypoint-script
:
|
Loading