Skip to content

Instantly share code, notes, and snippets.

@r0b0
Last active June 7, 2023 02:51
Show Gist options
  • Save r0b0/bdc0c0895d62a52520e62f39f8aa79c4 to your computer and use it in GitHub Desktop.
Save r0b0/bdc0c0895d62a52520e62f39f8aa79c4 to your computer and use it in GitHub Desktop.
running bitbucket ci runner on an unsupported architecture

Running bitbucket CI runner on an unsupported architecture

Prerequisites

  1. Java 11
  2. Docker

Procedure

  1. Download the runner package from atlassian e.g. https://product-downloads.atlassian.com/software/bitbucket/pipelines/atlassian-bitbucket-pipelines-runner-1.389.tar.gz
  2. Unpack runner.jar from the above to /opt/bitbucket-ci/
  3. Go to bitbucket.org settings page and add a runner, select Linux Docker x86 (even if your real architecture is different) and note ACCOUNT_UUID, REPOSITORY_UUID, RUNNER_UUID, OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET
  4. Edit /etc/bitbucket-runner.conf and fill in the options
  5. Add /etc/systemd/system/bitbucket-runner.service
  6. Start the services:

.

systemctl start bitbucket-runner.service
systemctl enable bitbucket-runner.service
# /etc/bitbucket-runner.conf
ACCOUNT_UUID={fill in}
REPOSITORY_UUID=
RUNNER_UUID={fill in}
OAUTH_CLIENT_ID=fill in
OAUTH_CLIENT_SECRET=fill in
WORKING_DIRECTORY=/tmp
RUNTIME_PREREQUISITES_ENABLED=true
RUNTIME=linux-docker
DOCKER_URI=unix:///var/run/docker.sock
RUNNER_ENVIRONMENT=PRODUCTION
SCHEDULED_STATE_UPDATE_INITIAL_DELAY_SECONDS=0
SCHEDULED_STATE_UPDATE_PERIOD_SECONDS=30
CLEANUP_PREVIOUS_FOLDERS=1
# /etc/systemd/system/bitbucket-runner.service
[Unit]
Description=Bitbucket CI Runner
Wants=docker.service
After=docker.service
[Service]
EnvironmentFile=/etc/bitbucket-runner.conf
WorkingDirectory=/usr/bin
ExecStart=/usr/bin/java \
-jar \
-Dbitbucket.pipelines.runner.account.uuid=${ACCOUNT_UUID} \
-Dbitbucket.pipelines.runner.repository.uuid=${REPOSITORY_UUID} \
-Dbitbucket.pipelines.runner.uuid=${RUNNER_UUID} \
-Dbitbucket.pipelines.runner.oauth.client.id=${OAUTH_CLIENT_ID} \
-Dbitbucket.pipelines.runner.oauth.client.secret=${OAUTH_CLIENT_SECRET} \
-Dbitbucket.pipelines.runner.directory.working=${WORKING_DIRECTORY} \
-Dbitbucket.pipelines.runner.environment=${RUNNER_ENVIRONMENT} \
-Dbitbucket.pipelines.runner.runtime=${RUNTIME} \
-Dbitbucket.pipelines.runner.docker.uri=${DOCKER_URI} \
-Dbitbucket.pipelines.runner.scheduled.state.update.initial.delay.seconds=${SCHEDULED_STATE_UPDATE_INITIAL_DELAY_SECONDS} \
-Dbitbucket.pipelines.runner.scheduled.state.update.period.seconds=${SCHEDULED_STATE_UPDATE_PERIOD_SECONDS} \
-Dbitbucket.pipelines.runner.cleanup.previous.folders=${CLEANUP_PREVIOUS_FOLDERS} \
-Dfile.encoding=UTF-8 \
-Dsun.jnu.encoding=UTF-8 \
/opt/bitbucket-ci/runner.jar
[Install]
WantedBy=multi-user.target
@wattnpapa
Copy link

Have you made it running on arm architecture?

@r0b0
Copy link
Author

r0b0 commented Feb 21, 2023

Yes, it's working on arm64

@bugb
Copy link

bugb commented Jun 7, 2023

is it working now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment