From 7aa2ee838ac1c183c235946b4c7059c1b759e6af Mon Sep 17 00:00:00 2001 From: Xin Huang Date: Sun, 14 May 2023 03:08:11 +0800 Subject: [PATCH 1/2] Add termination time when creating servers. Signed-off-by: Xin Huang --- .github/workflows/scripts/start-cil-runner.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/start-cil-runner.sh b/.github/workflows/scripts/start-cil-runner.sh index 2b0613e..88ea80a 100755 --- a/.github/workflows/scripts/start-cil-runner.sh +++ b/.github/workflows/scripts/start-cil-runner.sh @@ -17,8 +17,9 @@ user_data_scripts="#cloud-config\nusers:\n - default\n - name: smp\n # TODO: the options "operating_system", "facility", "plan" are hardcoded now, we should make them configurable # https://metal.equinix.com/developers/api/devices/#devices-createdevice +termination_time=`date --utc -d "110 minute" +"%FT%T.%3NZ"` device_id=$(curl -X POST -H "X-Auth-Token: $token" -s -H "Content-Type: application/json" \ --d '{"operating_system": "ubuntu_20_04", "facility": "da11", "plan": "c3.small.x86", "hostname": "'"${hostname}"'", "userdata": "'"${user_data_scripts}"'"}' \ +-d '{"operating_system": "ubuntu_20_04", "facility": "da11", "plan": "c3.small.x86", "hostname": "'"${hostname}"'", "userdata": "'"${user_data_scripts}"'", "termination_time": "'"${termination_time}"'"}' \ https://api.equinix.com/metal/v1/projects/96a9d336-541b-42f7-9827-d845010da550/devices | jq -r .id) if [[ -z $device_id ]]; then echo "ERROR: Failed to create CNCF CIL machine: $hostname..." From 712dcc15ab86073757723762f80d7c58bfe3c6dc Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Tue, 16 May 2023 09:17:01 +0800 Subject: [PATCH 2/2] Fix date format Signed-off-by: Huang Xin --- .github/workflows/scripts/start-cil-runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scripts/start-cil-runner.sh b/.github/workflows/scripts/start-cil-runner.sh index 88ea80a..8a7094a 100755 --- a/.github/workflows/scripts/start-cil-runner.sh +++ b/.github/workflows/scripts/start-cil-runner.sh @@ -17,7 +17,7 @@ user_data_scripts="#cloud-config\nusers:\n - default\n - name: smp\n # TODO: the options "operating_system", "facility", "plan" are hardcoded now, we should make them configurable # https://metal.equinix.com/developers/api/devices/#devices-createdevice -termination_time=`date --utc -d "110 minute" +"%FT%T.%3NZ"` +termination_time=`date --utc -d "110 minute" +"%FT%TZ"` device_id=$(curl -X POST -H "X-Auth-Token: $token" -s -H "Content-Type: application/json" \ -d '{"operating_system": "ubuntu_20_04", "facility": "da11", "plan": "c3.small.x86", "hostname": "'"${hostname}"'", "userdata": "'"${user_data_scripts}"'", "termination_time": "'"${termination_time}"'"}' \ https://api.equinix.com/metal/v1/projects/96a9d336-541b-42f7-9827-d845010da550/devices | jq -r .id)