Skip to content
Open
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
13 changes: 12 additions & 1 deletion .github/scripts/aws-packer-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@ sed -i "s#TEMPLATE_COSMIAN_AI_RUNNER_VERSION#$AI_RUNNER_VERSION#g" "$PACKER_FILE

cat "$PACKER_FILE"

packer init "$PACKER_FILE"
plugins='https://github.com/hashicorp/packer-plugin-ansible.git https://github.com/hashicorp/packer-plugin-amazon.git'

for plugin in $plugins; do
git clone $plugin
plugin_name=$(echo "$plugin" | sed -E 's#.*/([^/]+)\.git#\1#')
cd $plugin_name
go build
./$plugin_name describe
plugin_name_short=$(echo "$plugin_name" | sed 's/.*-//')
packer plugins install --path $plugin_name releases.hashicorp.com/$plugin_name/$plugin_name_short
cd ..
done

# Since packer build fails randomly because of external resources use, retry packer build until it succeeds
timeout 60m bash -c "until packer build $PACKER_FILE; do sleep 30; done"
13 changes: 12 additions & 1 deletion .github/scripts/azure-packer-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@ fi

cat "$PACKER_FILE"

packer init "$PACKER_FILE"
plugins='https://github.com/hashicorp/packer-plugin-ansible.git https://github.com/hashicorp/packer-plugin-azure.git'

for plugin in $plugins; do
git clone $plugin
plugin_name=$(echo "$plugin" | sed -E 's#.*/([^/]+)\.git#\1#')
cd $plugin_name
go build
./$plugin_name describe
plugin_name_short=$(echo "$plugin_name" | sed 's/.*-//')
packer plugins install --path $plugin_name releases.hashicorp.com/$plugin_name/$plugin_name_short
cd ..
done

# Since packer build fails randomly because of external resources use, retry packer build until it succeeds
timeout 60m bash -c "until packer build -force $PACKER_FILE; do sleep 30; done"
13 changes: 12 additions & 1 deletion .github/scripts/gcp-packer-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ sed -i "s#TEMPLATE_COSMIAN_AI_RUNNER_VERSION#$AI_RUNNER_VERSION#g" "$PACKER_FILE

cat "$PACKER_FILE"

packer init "$PACKER_FILE"
plugins='https://github.com/hashicorp/packer-plugin-ansible.git https://github.com/hashicorp/packer-plugin-googlecompute.git'

for plugin in $plugins; do
git clone $plugin
plugin_name=$(echo "$plugin" | sed -E 's#.*/([^/]+)\.git#\1#')
cd $plugin_name
go build
./$plugin_name describe
plugin_name_short=$(echo "$plugin_name" | sed 's/.*-//')
packer plugins install --path $plugin_name releases.hashicorp.com/$plugin_name/$plugin_name_short
cd ..
done

# Since packer build fails randomly because of external resources use, retry packer build until it succeeds
timeout 60m bash -c "until packer build $PACKER_FILE; do sleep 30; done"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
sudo curl -fsSLo /usr/share/keyrings/intel-sgx-deb.asc https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.asc] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update && sudo apt-get install -y tpm2-tools libtss2-dev libtdx-attest-dev
sudo apt-get update && sudo apt-get install -y tpm2-tools libtss2-dev libtdx-attest-dev golang-go

- name: Install Rust toolchain and components
if: steps.cargo-cache.outputs.cache-hit != 'true'
Expand Down
13 changes: 0 additions & 13 deletions packer/aws.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
packer {
required_plugins {
amazon = {
version = "= 1.3.0"
source = "github.com/hashicorp/amazon"
}
ansible = {
version = "= 1.1.1"
source = "github.com/hashicorp/ansible"
}
}
}

source "amazon-ebssurrogate" "TEMPLATE_DISTRIBUTION" {
ssh_username = "TEMPLATE_SSH_USERNAME"
ssh_timeout = "5m"
Expand Down
13 changes: 0 additions & 13 deletions packer/azure.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
packer {
required_plugins {
azure = {
version = "= 2.1.4"
source = "github.com/hashicorp/azure"
}
ansible = {
version = "= 1.1.1"
source = "github.com/hashicorp/ansible"
}
}
}

source "azure-arm" "TEMPLATE_DISTRIBUTION" {
ssh_username = "packer"
ssh_timeout = "5m"
Expand Down
13 changes: 0 additions & 13 deletions packer/gcp.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
packer {
required_plugins {
googlecompute = {
version = "= 1.1.4"
source = "github.com/hashicorp/googlecompute"
}
ansible = {
version = "= 1.1.1"
source = "github.com/hashicorp/ansible"
}
}
}

source "googlecompute" "TEMPLATE_GOOGLE_COMPUTE" {
ssh_username = "root"
ssh_timeout = "5m"
Expand Down
Loading