Skip to content

Commit f5992b7

Browse files
Allow using LXD image mirror
This change allows GARM tests to use a mirror for LXD images, allowing for faster image downloads. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent 3b1e3c7 commit f5992b7

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.github/workflows/integration-tests.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818

1919
- name: Setup LXD
2020
uses: canonical/setup-lxd@main
21+
with:
22+
channel: latest/stable
2123

2224
- name: Install dependencies
2325
run: |
@@ -42,9 +44,9 @@ jobs:
4244
4345
echo "GARM_BASE_URL=$GARM_BASE_URL" >> $GITHUB_ENV
4446
45-
cat <<EOF | sudo tee /etc/systemd/system/localshow-tunnel.service
47+
cat <<EOF | sudo tee /etc/systemd/system/garm-tunnel.service
4648
[Unit]
47-
Description=Localshow tunnel
49+
Description=GARM tunnel
4850
After=network.target
4951
5052
[Service]
@@ -57,8 +59,8 @@ jobs:
5759
EOF
5860
5961
sudo systemctl daemon-reload
60-
sudo systemctl enable localshow-tunnel
61-
sudo systemctl start localshow-tunnel
62+
sudo systemctl enable garm-tunnel
63+
sudo systemctl start garm-tunnel
6264
6365
- name: Generate secrets
6466
run: |
@@ -90,6 +92,7 @@ jobs:
9092
CREDENTIALS_NAME: test-garm-creds
9193
WORKFLOW_FILE_NAME: test.yml
9294
GH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}
95+
LXD_REMOTE_SERVER: ${{ secrets.LXD_REMOTE_SERVER }}
9396

9497
- name: Show GARM logs
9598
if: always()

test/integration/config/garm-provider-lxd.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ secure_boot = false
55
project_name = "default"
66
[image_remotes]
77
[image_remotes.ubuntu]
8-
addr = "https://cloud-images.ubuntu.com/releases"
8+
addr = "${LXD_REMOTE_SERVER}"
99
public = true
1010
protocol = "simplestreams"
1111
skip_verify = false

test/integration/external_provider_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func (suite *GarmSuite) TestExternalProvider() {
2222
MaxRunners: 2,
2323
MinIdleRunners: 0,
2424
Flavor: "default",
25-
Image: "ubuntu:22.04",
25+
Image: "ubuntu:24.04",
2626
OSType: commonParams.Linux,
2727
OSArch: commonParams.Amd64,
2828
ProviderName: "test_external",

test/integration/organizations_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (suite *GarmSuite) TestOrganizations() {
2929
MaxRunners: 2,
3030
MinIdleRunners: 0,
3131
Flavor: "default",
32-
Image: "ubuntu:22.04",
32+
Image: "ubuntu:24.04",
3333
OSType: commonParams.Linux,
3434
OSArch: commonParams.Amd64,
3535
ProviderName: "lxd_local",

test/integration/repositories_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (suite *GarmSuite) TestRepositories() {
5757
MaxRunners: 2,
5858
MinIdleRunners: 0,
5959
Flavor: "default",
60-
Image: "ubuntu:22.04",
60+
Image: "ubuntu:24.04",
6161
OSType: commonParams.Linux,
6262
OSArch: commonParams.Amd64,
6363
ProviderName: "lxd_local",

test/integration/scripts/setup-garm.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export RUN_USER=${RUN_USER:-$USER}
1414
export GARM_PORT=${GARM_PORT:-"9997"}
1515
export GARM_SERVICE_NAME=${GARM_SERVICE_NAME:-"garm"}
1616
export GARM_CONFIG_FILE=${GARM_CONFIG_FILE:-"${GARM_CONFIG_DIR}/config.toml"}
17+
export LXD_REMOTE_SERVER=${LXD_REMOTE_SERVER:-"https://cloud-images.ubuntu.com/releases"}
1718

1819
if [ -f "$GITHUB_ENV" ];then
1920
echo "export GARM_CONFIG_DIR=${GARM_CONFIG_DIR}" >> $GITHUB_ENV
@@ -66,7 +67,7 @@ sudo chown -R $RUN_USER:$RUN_USER ${GARM_CONFIG_DIR}
6667

6768
export LXD_PROVIDER_EXECUTABLE="$PROVIDER_BIN_DIR/garm-provider-lxd"
6869
export LXD_PROVIDER_CONFIG="${GARM_CONFIG_DIR}/garm-provider-lxd.toml"
69-
sudo cp $CONFIG_DIR/garm-provider-lxd.toml $LXD_PROVIDER_CONFIG
70+
cat $CONFIG_DIR/garm-provider-lxd.toml| envsubst | sudo tee $LXD_PROVIDER_CONFIG > /dev/null
7071

7172
function clone_and_build_lxd_provider() {
7273
git clone https://github.com/cloudbase/garm-provider-lxd ~/garm-provider-lxd

0 commit comments

Comments
 (0)