Skip to content

Commit 6ef47e0

Browse files
authored
Merge 301eef3 into sapling-pr-archive-ktf
2 parents 96a171f + 301eef3 commit 6ef47e0

File tree

72 files changed

+383
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+383
-877
lines changed

.github/workflows/check-image-definitions.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919
- name: Install prerequisites
2020
run: |
2121
sudo apt update -y
22-
sudo apt install -y packer
22+
23+
# The packer provided by Ubuntu repos is ancient
24+
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
25+
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
26+
sudo apt-get update && sudo apt-get install packer
2327
packer plugins install github.com/hashicorp/docker
2428
2529
- name: Validate Packer images

.github/workflows/push-docker-image.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Push Docker image
1010
image-name:
1111
description: Docker image to build
1212
required: true
13-
default: slc8-builder
13+
default: slc9-builder
1414

1515
permissions:
1616
contents: read
@@ -20,38 +20,48 @@ jobs:
2020
# This workflow contains a single job called "build"
2121
build:
2222
# The type of runner that the job will run on
23-
runs-on: ubuntu-latest
24-
# GitHub seems to install an odd version of docker on the host, so run in a
25-
# container and only connect to the host's docker daemon.
26-
container:
27-
image: ubuntu:22.04
28-
volumes:
29-
# Connect to host's docker daemon so we don't run docker inside docker.
30-
- /var/run/docker.sock:/var/run/docker.sock
23+
runs-on: ubuntu-22.04
3124

3225
# Steps represent a sequence of tasks that will be executed as part of the job
3326
steps:
3427
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3528
- uses: actions/checkout@v3
3629

30+
# Some images are too large and we run out of disk space, so try to free some
31+
- name: Free disk space
32+
run: |
33+
# https://github.com/jlumbroso/free-disk-space
34+
set -ex
35+
sudo rm -rf /usr/local/lib/android || true
36+
sudo rm -rf /usr/share/dotnet || true
37+
sudo rm -rf /opt/ghc || true
38+
sudo rm -rf /usr/local/.ghcup || true
39+
sudo docker image prune --all --force || true
40+
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
41+
3742
- name: Install prerequisites
3843
run: |
39-
apt update -y
40-
apt install -y software-properties-common
41-
add-apt-repository universe
42-
apt install -y docker.io packer
44+
sudo apt update -y
45+
sudo apt install -y software-properties-common
46+
sudo add-apt-repository universe
47+
48+
# containerd.io conflicts with docker.io
49+
sudo apt-get remove containerd.io
50+
sudo apt install -y docker.io
51+
52+
# The packer provided by Ubuntu repos is ancient
53+
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
54+
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
55+
sudo apt-get update && sudo apt-get install packer
4356
packer plugins install github.com/hashicorp/docker
4457
env:
4558
DEBIAN_FRONTEND: noninteractive
4659

47-
- name: Log in to Docker repos
60+
- name: Log in to Docker repo
4861
run: |
4962
docker login registry.cern.ch -u '${{ secrets.CERN_REGISTRY_USER }}' --password-stdin <<\EOF
5063
${{ secrets.CERN_REGISTRY_PASSWORD }}
5164
EOF
52-
docker login docker.io -u '${{ secrets.DOCKERHUB_USER }}' --password-stdin <<\EOF
53-
${{ secrets.DOCKERHUB_PASSWORD }}
54-
EOF
5565
5666
- name: Build and push docker image
5767
run: |
@@ -61,3 +71,4 @@ jobs:
6171
fi
6272
packer validate packer.json
6373
packer build packer.json
74+
docker push registry.cern.ch/alisw/${{ github.event.inputs.image-name }}

README.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,6 @@
88
- elasticsearch: a customized elasticsearch instance with HEAD and Marvel plugins
99
installed.
1010

11-
## Building images with packer
11+
## Building images
1212

13-
Newer images have a `packer.json` file, which allows them to be built using
14-
Hashicorp [packer](https://www.packer.io). This has the nice advantage that we
15-
can customize and upload the images in one go. To build them:
16-
17-
```bash
18-
brew install packer # > 0.10.0
19-
cd <image-name>
20-
packer build packer.json
21-
```
22-
23-
If you don't want to upload the finished image to DockerHub (e.g. if you're just
24-
testing changes to the image, or you don't have the rights to upload), remove
25-
the `"docker-push"` entry from `"post-processors"` in the `packer.json` you're
26-
using. (JSON doesn't allow trailing commas in arrays, so don't forget to remove
27-
the comma as well!)
28-
29-
## Building with docker
30-
31-
Older images without a `packer.json` can be built with:
32-
33-
```bash
34-
docker build -t alisw/<image-name> <image-name>
35-
```
13+
This documentation has moved to [alisw.github.io](https://alisw.github.io/infrastructure-docker-packer)

arm64-builder/packer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
"repository": "{{user `project`}}/arm64-builder",
3434
"tag": "latest"
3535
},
36-
"docker-push"
36+
{
37+
"type": "shell-local",
38+
"inline": ["echo 'The image was built successfully. To push the image to the registry, you can run: docker push {{user `REPO`}}:{{user `TAG`}}'"]
39+
}
3740
]
3841
]
3942
}

aurora-base/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

aurora-base/aurora.repo

Lines changed: 0 additions & 4 deletions
This file was deleted.

aurora-executor/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

aurora-executor/aurora.repo

Lines changed: 0 additions & 4 deletions
This file was deleted.

aurora-executor/packer.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

aurora-scheduler/aurora.repo

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)