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

add TARGETARCH to docker image build (#617) #618

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions org.eclipse.mylyn.releng/multipass/mylyn_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
- gitlab
vars:
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
gitlabImageVersion: "16.11.1"
gitlabImageVersion: "17.4.0"
gitlabHostURL: "gitlab.{{ hostvars['localhost'].mylyn_service_domain }}"
- role: jenkins
tags:
Expand All @@ -125,6 +125,7 @@
# - { servmame: "jenkins-2_303_3", port1: 8081, port2: 50001, data_dir: "jenkins-2.303.3", image_tag: "jenkins/jenkins:2.303.3-lts-jdk11", extra_info: '' }
# - { servmame: "jenkins-1_651_1", port1: 8084, port2: 50004, data_dir: "jenkins-2.303.3", image_tag: "jenkins:1.651.1", extra_info: '"' }
- { servmame: "jenkins-latest-jdk11", port1: 8083, port2: 50003, data_dir: "jenkins-2.303.3", image_tag: "jenkins/jenkins:latest-jdk11", extra_info: '"default": "true"' }
- { servmame: "jenkins-latest", port1: 8084, port2: 50004, data_dir: "jenkins-2.303.3", image_tag: "jenkins/jenkins:latest", extra_info: '' }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why two Jenkins instances of the same version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why two Jenkins instances of the same version?

No, they are different versions latest-jdk11 is 2.462 and latest is 2.477

But you are right, we only need one. This was just a test on my side and I forgot to remove this. I created an other commit and comment that line out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, was just looking at the data set version (2.303.3)

# - { servmame: "jenkinsci", port1: 8082, port2: 50002, data_dir: "jenkinsci", image_tag: "jenkins/jenkins:2.375.2-lts", extra_info: '"local_test_service":"true"' }
- role: bugzilla
tags:
Expand All @@ -136,6 +137,6 @@
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-custom-wf", port1: 8091, port2: 8491, image_tag: "4.4-custom_wf", extra_info: '"custom_wf":"true"' }
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-custom-wf-and-status", port1: 8092, port2: 8492, image_tag: "4.4-custom_wf_a_s", extra_info: '"custom_wf_and_status":"true"' }
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-bugaliases", port1: 8093, port2: 8493, image_tag: "4.4-bugaliases", extra_info: '"use_bug_alias":"true"' }
# - { git_branch: "5.2", servmame: "bugzilla-5_2", port1: 8094, port2: 8494, image_tag: "5.2", extra_info: '' }
- { git_branch: "5.2", servmame: "bugzilla-5_2", port1: 8094, port2: 8494, image_tag: "5.2", extra_info: '' }
- { git_branch: "5.2", servmame: "bugzilla-5_2-rest", port1: 8095, port2: 8495, image_tag: "5.2-rest", extra_info: '"rest_enabled":"true", "default": "true", "testdataVersion": "Version1"' }
- { git_branch: "5.2", servmame: "bugzilla-5_2-rest-api", port1: 8096, port2: 8496, image_tag: "5.2-rest-api", extra_info: '"rest_enabled": "true", "api_key_enabled": "true", "testdataVersion": "Version1"' }
22 changes: 13 additions & 9 deletions org.eclipse.mylyn.releng/multipass/roles/gitlab/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
container_default_behavior: no_defaults
state: stopped
failed_when: false

- name: Remove Stoped docker container
ansible.builtin.shell: |
docker rm gitlab
failed_when: false

- name: Remove own image
community.docker.docker_image:
name: "127.0.0.1:5000/mylyn-gitlab-ce"
state: absent
force_absent: true
failed_when: false

- name: Recursively remove directory
ansible.builtin.file:
path: "{{ item }}"
Expand Down Expand Up @@ -49,7 +49,7 @@
traefik.http.services.{{ role_name }}.loadbalancer.server.port: "8888" ,
org.eclipse.mylyn.service: "{{ serviceLabel | from_yaml }}"
}

- name: Creates directory
ansible.builtin.file:
path: "{{ item }}"
Expand Down Expand Up @@ -88,8 +88,10 @@
content: |
RELEASE_PACKAGE=gitlab-ce
RELEASE_VERSION={{gitlabImageVersion}}-ce
DOWNLOAD_URL_amd64=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/jammy/gitlab-ce_{{gitlabImageVersion}}-ce.0_amd64.deb/download.deb
DOWNLOAD_URL_arm64=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/jammy/gitlab-ce_{{gitlabImageVersion}}-ce.0_arm64.deb/download.deb
DOWNLOAD_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/jammy/gitlab-ce_{{gitlabImageVersion}}-ce.0_arm64.deb/download.deb

- name: create change Dockerfile
ansible.builtin.copy:
dest: /mylyn-config-dir/{{ role_name }}/changeDockerfile.sh
Expand All @@ -101,15 +103,15 @@
sed -ie '/libperl5.34 \\/a \ \ \ \ \ \ libatomic1 \\' Dockerfile
sed -ie 's@/assets RELEASE ; \\@/assets RELEASE@g' Dockerfile
sed -ie 's@ /assets/setup@RUN /assets/setup@g' Dockerfile

- name: change Dockerfile
ansible.builtin.shell:
cmd: /mylyn-config-dir/{{ role_name }}/changeDockerfile.sh

- name: set gitlabImageName
ansible.builtin.set_fact:
gitlabImageName: "127.0.0.1:5000/mylyn-gitlab-ce"

- name: Build the image
community.docker.docker_image:
name: "127.0.0.1:5000/mylyn-gitlab-ce"
Expand All @@ -118,6 +120,8 @@
build:
nocache: true
path: /mylyn-config-dir/{{ role_name }}/omnibus-gitlab/docker
args:
TARGETARCH: arm64
source: build
when: (ansible_facts['distribution'] +'/' + ansible_facts['architecture'] == 'Ubuntu/aarch64')

Expand All @@ -126,13 +130,13 @@
- name: set gitlabImageName
ansible.builtin.set_fact:
gitlabImageName: "gitlab/gitlab-ce:{{gitlabImageVersion}}-ce.0"

- name: Pull image
community.docker.docker_image:
name: "{{ gitlabImageName }}"
source: pull
when: (ansible_facts['distribution'] +'/' + ansible_facts['architecture'] != 'Ubuntu/aarch64')

- name: Deploy Container
community.docker.docker_container:
name: "gitlab"
Expand Down