Skip to content

Commit

Permalink
Install snapd on ubuntu and create OS group snap_sudo that can be use…
Browse files Browse the repository at this point in the history
…d in tasks to run snap commands
  • Loading branch information
petemoore committed Feb 14, 2024
1 parent 3553266 commit df4fa50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion imagesets/generic-worker-ubuntu-22-04-staging/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ retry apt-get update
DEBIAN_FRONTEND=noninteractive retry apt-get upgrade -yq
retry apt-get -y remove docker docker.io containerd runc
# build-essential is needed for running `go test -race` with the -vet=off flag as of go1.19
retry apt-get install -y apt-transport-https ca-certificates curl software-properties-common gzip python3-venv build-essential
retry apt-get install -y apt-transport-https ca-certificates curl software-properties-common gzip python3-venv build-essential snapd

# install docker
retry curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Expand All @@ -66,6 +66,10 @@ cat > /etc/modprobe.d/kvm-backdoor.conf << "EOF"
options kvm enable_vmware_backdoor=y
EOF

# create group for running snap
groupadd snap_sudo
echo '%snap_sudo ALL=(ALL:ALL) NOPASSWD: /usr/bin/snap' | EDITOR='tee -a' visudo

# build generic-worker/livelog/start-worker/taskcluster-proxy from ${TASKCLUSTER_REF} commit / branch / tag etc
retry apt-get install -y git tar
retry curl -fsSL 'https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz' > go.tar.gz
Expand Down
6 changes: 5 additions & 1 deletion imagesets/generic-worker-ubuntu-22-04/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ retry apt-get update
DEBIAN_FRONTEND=noninteractive retry apt-get upgrade -yq
retry apt-get -y remove docker docker.io containerd runc
# build-essential is needed for running `go test -race` with the -vet=off flag as of go1.19
retry apt-get install -y apt-transport-https ca-certificates curl software-properties-common gzip python3-venv build-essential
retry apt-get install -y apt-transport-https ca-certificates curl software-properties-common gzip python3-venv build-essential snapd

# install docker
retry curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Expand All @@ -64,6 +64,10 @@ cat > /etc/modprobe.d/kvm-backdoor.conf << "EOF"
options kvm enable_vmware_backdoor=y
EOF

# create group for running snap
groupadd snap_sudo
echo '%snap_sudo ALL=(ALL:ALL) NOPASSWD: /usr/bin/snap' | EDITOR='tee -a' visudo

cd /usr/local/bin
retry curl -fsSL "https://github.com/taskcluster/taskcluster/releases/download/${TASKCLUSTER_VERSION}/generic-worker-multiuser-linux-${ARCH}" > generic-worker
retry curl -fsSL "https://github.com/taskcluster/taskcluster/releases/download/${TASKCLUSTER_VERSION}/start-worker-linux-${ARCH}" > start-worker
Expand Down

0 comments on commit df4fa50

Please sign in to comment.