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

Fix running CML inside CML with pkg binaries #458

Merged
merged 6 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion iterative/resource_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export KUBERNETES_CONFIGURATION={{escape .KUBERNETES_CONFIGURATION}}
{{.runner_startup_script}}
{{- end}}

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
HOME="$(mktemp -d)" exec $(which cml-runner || echo $(which cml-internal || echo cml) runner) \
{{if .name}} --name {{escape .name}}{{end}} \
{{if .labels}} --labels {{escape .labels}}{{end}} \
{{if .idle_timeout}} --idle-timeout {{escape .idle_timeout}}{{end}} \
Expand Down
2 changes: 1 addition & 1 deletion iterative/testdata/script_template_cloud_aws.golden
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ 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'

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
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' \
--idle-timeout 11 \
Expand Down
2 changes: 1 addition & 1 deletion iterative/testdata/script_template_cloud_azure.golden
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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'

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
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' \
--idle-timeout 11 \
Expand Down
2 changes: 1 addition & 1 deletion iterative/testdata/script_template_cloud_gcp.golden
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sudo tee /usr/bin/cml.sh << 'EOF'
#!/bin/sh
export GOOGLE_APPLICATION_CREDENTIALS_DATA='7 value with "quotes" and spaces'

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
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' \
--idle-timeout 11 \
Expand Down
2 changes: 1 addition & 1 deletion iterative/testdata/script_template_cloud_invalid.golden
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sudo npm config set user 0 && sudo npm install --global 18 value with "quotes" a
sudo tee /usr/bin/cml.sh << 'EOF'
#!/bin/sh

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
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' \
--idle-timeout 11 \
Expand Down
2 changes: 1 addition & 1 deletion iterative/testdata/script_template_cloud_kubernetes.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sudo systemctl is-enabled cml.service && return 0
export KUBERNETES_CONFIGURATION='8 value with "quotes" and spaces'

HOME="$(mktemp -d)" exec $(which cml-runner || echo "cml runner") \
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' \
--idle-timeout 11 \
Expand Down
3 changes: 2 additions & 1 deletion iterative/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func getGHCML(v string) string {
return fmt.Sprintf(`sudo mkdir -p /opt/cml/
sudo curl --location --url %s --output /opt/cml/cml-linux
sudo chmod +x /opt/cml/cml-linux
sudo ln -s /opt/cml/cml-linux /usr/bin/cml`, v)
sudo ln -s /opt/cml/cml-linux /usr/bin/cml
sudo ln /opt/cml/cml-linux /usr/bin/cml-internal`, v) // hard link to fix cml#920
}

func getNPMCML(v string) string {
Expand Down