Skip to content

Commit

Permalink
Cml cloud runner destroy one (#316)
Browse files Browse the repository at this point in the history
* [wip] CML contexts

* octokit on demand

* token

* clean env before tests

* print env

* yaml

* yaml

* yaml

* yaml

* check

* fix repo env

* fix repo env

* fix repo env

* fix repo env

* check name

* env github tests

* env github tests

* log check

* log check

* no check tessts

* enviromental tests

* workflow eenv

* gitlab uploads and github_token

* snapshots

* Cml contexts (#314)

* token

* clean env before tests

* print env

* yaml

* yaml

* yaml

* yaml

* check

* fix repo env

* fix repo env

* fix repo env

* fix repo env

* check name

* env github tests

* env github tests

* log check

* log check

* no check tessts

* enviromental tests

* workflow eenv

* gitlab uploads and github_token

* snapshots

* docker entrypooint

* docker entrypoint register_runner

* update templates

* token repo

* token repo

* specify driver

* log env

* log env

* Destroy one tf resource

* update also github.context

* Cml contexts sha fix (#315)

* token

* clean env before tests

* print env

* yaml

* yaml

* yaml

* yaml

* check

* fix repo env

* fix repo env

* fix repo env

* fix repo env

* check name

* env github tests

* env github tests

* log check

* log check

* no check tessts

* enviromental tests

* workflow eenv

* gitlab uploads and github_token

* snapshots

* log env

* log env

* update also github.context

* No log

* point to iterative repos

* point to iterative repos without slash

* point to iterative ai

* test slash

* test slash

* fix strip

* removal of strip

* refactor

* slash

* minor refactor

* no console

* Cml contexts sha (#326)

* git sha

* commit_sha

* log

* log gh sha

* log gh sha

* show origin

* remote as repo

* remote as repo

* tests

* remove one test not working on gitlab

* space

* publish backend

* no banckend in publish
  • Loading branch information
DavidGOrtega authored Oct 28, 2020
1 parent 779f49b commit 0749ac9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/cml-cloud-runner-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
RUNNER_EXECUTOR = 'shell',
RUNNER_RUNTIME = '',
RUNNER_IMAGE = 'dvcorg/cml:latest',
RUNNER_TF_NAME,

RUNNER_DRIVER,
RUNNER_REPO,
Expand Down Expand Up @@ -49,8 +50,11 @@ const shutdown_host = async () => {
try {
console.log('Terraform destroy...');
try {
const tf_resource = RUNNER_TF_NAME ? `-target=${RUNNER_TF_NAME}` : '';
console.log(
await exec('cd / && terraform init && terraform destroy -auto-approve')
await exec(
`cd / && terraform init && terraform destroy -auto-approve ${tf_resource}`
)
);
} catch (err) {
console.log(`Failed destroying terraform: ${err.message}`);
Expand Down
1 change: 1 addition & 0 deletions bin/cml-cloud-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const setup_runners = async (opts) => {
-e AWS_ACCESS_KEY_ID=${process.env.AWS_ACCESS_KEY_ID} \
-v $(pwd)/terraform.tfstate:/terraform.tfstate \
-v $(pwd)/main.tf:/main.tf \
-e "RUNNER_TF_NAME=iterative_machine.${resource.name}" \
-e "repo_token=${repo_token}" \
-e "RUNNER_REPO=${runner_repo}" \
-e "RUNNER_DRIVER=${driver}" \
Expand Down

1 comment on commit 0749ac9

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Comment

Please sign in to comment.