Skip to content

Commit 81872fa

Browse files
0x2b3bfa0casperdcl
andauthored
Fix running CML inside CML with pkg binaries (#458)
Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org>
1 parent 7b14283 commit 81872fa

7 files changed

+8
-7
lines changed

iterative/resource_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export KUBERNETES_CONFIGURATION={{escape .KUBERNETES_CONFIGURATION}}
341341
{{.runner_startup_script}}
342342
{{- end}}
343343
344-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
344+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
345345
{{if .name}} --name {{escape .name}}{{end}} \
346346
{{if .labels}} --labels {{escape .labels}}{{end}} \
347347
{{if .idle_timeout}} --idle-timeout {{escape .idle_timeout}}{{end}} \

iterative/testdata/script_template_cloud_aws.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export AWS_SECRET_ACCESS_KEY='0 value with "quotes" and spaces'
4444
export AWS_ACCESS_KEY_ID='1 value with "quotes" and spaces'
4545
export AWS_SESSION_TOKEN='2 value with "quotes" and spaces'
4646
47-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
47+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
4848
--name '10 value with "quotes" and spaces' \
4949
--labels '16 value with "quotes" and spaces' \
5050
--idle-timeout 11 \

iterative/testdata/script_template_cloud_azure.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export AZURE_CLIENT_SECRET='4 value with "quotes" and spaces'
4545
export AZURE_SUBSCRIPTION_ID='5 value with "quotes" and spaces'
4646
export AZURE_TENANT_ID='6 value with "quotes" and spaces'
4747
48-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
48+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
4949
--name '10 value with "quotes" and spaces' \
5050
--labels '16 value with "quotes" and spaces' \
5151
--idle-timeout 11 \

iterative/testdata/script_template_cloud_gcp.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sudo tee /usr/bin/cml.sh << 'EOF'
4242
#!/bin/sh
4343
export GOOGLE_APPLICATION_CREDENTIALS_DATA='7 value with "quotes" and spaces'
4444
45-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
45+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
4646
--name '10 value with "quotes" and spaces' \
4747
--labels '16 value with "quotes" and spaces' \
4848
--idle-timeout 11 \

iterative/testdata/script_template_cloud_invalid.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sudo npm config set user 0 && sudo npm install --global 18 value with "quotes" a
4141
sudo tee /usr/bin/cml.sh << 'EOF'
4242
#!/bin/sh
4343
44-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
44+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
4545
--name '10 value with "quotes" and spaces' \
4646
--labels '16 value with "quotes" and spaces' \
4747
--idle-timeout 11 \

iterative/testdata/script_template_cloud_kubernetes.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sudo systemctl is-enabled cml.service && return 0
33
export KUBERNETES_CONFIGURATION='8 value with "quotes" and spaces'
44

5-
HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
5+
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
66
--name '10 value with "quotes" and spaces' \
77
--labels '16 value with "quotes" and spaces' \
88
--idle-timeout 11 \

iterative/utils/helpers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ func getGHCML(v string) string {
4444
return fmt.Sprintf(`sudo mkdir -p /opt/cml/
4545
sudo curl --location --url %s --output /opt/cml/cml-linux
4646
sudo chmod +x /opt/cml/cml-linux
47-
sudo ln -s /opt/cml/cml-linux /usr/bin/cml`, v)
47+
sudo ln -s /opt/cml/cml-linux /usr/bin/cml
48+
sudo ln /opt/cml/cml-linux /usr/bin/cml-internal`, v) // hard link to fix cml#920
4849
}
4950

5051
func getNPMCML(v string) string {

0 commit comments

Comments
 (0)