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

Wait for apt to finish #621

Merged
merged 9 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
17 changes: 9 additions & 8 deletions environment/setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#/bin/sh
FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
export DEBIAN_FRONTEND=noninteractive
PS4='tpi:setup.sh: '
set -x
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes
PS4='tpi:setup.sh: '
set -x

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
export DEBIAN_FRONTEND=noninteractive
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
dacbd marked this conversation as resolved.
Show resolved Hide resolved

FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install -y software-properties-common build-essential git acpid
Expand Down
2 changes: 2 additions & 0 deletions iterative/resource_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ export KUBERNETES_CONFIGURATION={{escape .KUBERNETES_CONFIGURATION}}
{{- end}}
{{- end}}

while test -f /var/lib/dpkg/lock; do sleep 1; done

{{- if .runner_startup_script}}
{{.runner_startup_script}}
{{- end}}
Expand Down
19 changes: 11 additions & 8 deletions iterative/testdata/script_template_cloud_aws.golden
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh
sudo systemctl is-enabled cml.service && return 0
FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
export DEBIAN_FRONTEND=noninteractive
PS4='tpi:setup.sh: '
set -x
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes
PS4='tpi:setup.sh: '
set -x

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
export DEBIAN_FRONTEND=noninteractive
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service

FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install -y software-properties-common build-essential git acpid
Expand Down Expand Up @@ -49,6 +50,8 @@ export AWS_SECRET_ACCESS_KEY='0 value with "quotes" and spaces'
export AWS_ACCESS_KEY_ID='1 value with "quotes" and spaces'
export AWS_SESSION_TOKEN='2 value with "quotes" and spaces'

while test -f /var/lib/dpkg/lock; do sleep 1; done

HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
--name '10 value with "quotes" and spaces' \
--labels '16 value with "quotes" and spaces' \
Expand Down
19 changes: 11 additions & 8 deletions iterative/testdata/script_template_cloud_azure.golden
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh
sudo systemctl is-enabled cml.service && return 0
FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
export DEBIAN_FRONTEND=noninteractive
PS4='tpi:setup.sh: '
set -x
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes
PS4='tpi:setup.sh: '
set -x

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
export DEBIAN_FRONTEND=noninteractive
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service

FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install -y software-properties-common build-essential git acpid
Expand Down Expand Up @@ -50,6 +51,8 @@ export AZURE_CLIENT_SECRET='4 value with "quotes" and spaces'
export AZURE_SUBSCRIPTION_ID='5 value with "quotes" and spaces'
export AZURE_TENANT_ID='6 value with "quotes" and spaces'

while test -f /var/lib/dpkg/lock; do sleep 1; done

HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
--name '10 value with "quotes" and spaces' \
--labels '16 value with "quotes" and spaces' \
Expand Down
19 changes: 11 additions & 8 deletions iterative/testdata/script_template_cloud_gcp.golden
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh
sudo systemctl is-enabled cml.service && return 0
FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
export DEBIAN_FRONTEND=noninteractive
PS4='tpi:setup.sh: '
set -x
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes
PS4='tpi:setup.sh: '
set -x

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
export DEBIAN_FRONTEND=noninteractive
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service

FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install -y software-properties-common build-essential git acpid
Expand Down Expand Up @@ -48,6 +49,8 @@ sudo tee /usr/bin/cml.sh << 'EOF'
export GOOGLE_APPLICATION_CREDENTIALS_DATA=''
export CML_GCP_ACCESS_TOKEN=''

while test -f /var/lib/dpkg/lock; do sleep 1; done

HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
--name '10 value with "quotes" and spaces' \
--labels '16 value with "quotes" and spaces' \
Expand Down
19 changes: 11 additions & 8 deletions iterative/testdata/script_template_cloud_invalid.golden
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh
sudo systemctl is-enabled cml.service && return 0
FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
export DEBIAN_FRONTEND=noninteractive
PS4='tpi:setup.sh: '
set -x
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes
PS4='tpi:setup.sh: '
set -x

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service
export DEBIAN_FRONTEND=noninteractive
echo "APT::Get::Assume-Yes \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90assumeyes

sudo apt remove unattended-upgrades
systemctl disable apt-daily-upgrade.service

FILE=/var/log/cml_stack.log
if [ ! -f "$FILE" ]; then
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install -y software-properties-common build-essential git acpid
Expand Down Expand Up @@ -46,6 +47,8 @@ sudo npm config set user 0 && sudo npm install --global 18 value with "quotes" a
sudo tee /usr/bin/cml.sh << 'EOF'
#!/bin/sh

while test -f /var/lib/dpkg/lock; do sleep 1; done

HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
--name '10 value with "quotes" and spaces' \
--labels '16 value with "quotes" and spaces' \
Expand Down
2 changes: 2 additions & 0 deletions iterative/testdata/script_template_cloud_kubernetes.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
sudo systemctl is-enabled cml.service && return 0
export KUBERNETES_CONFIGURATION='8 value with "quotes" and spaces'

while test -f /var/lib/dpkg/lock; do sleep 1; done

HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
--name '10 value with "quotes" and spaces' \
--labels '16 value with "quotes" and spaces' \
Expand Down