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

Update Orka Packer image MacOS 13 test images generation #3885

Merged
merged 5 commits into from
Sep 2, 2024
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
21 changes: 14 additions & 7 deletions .github/workflows/orka-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ jobs:
uses: hashicorp/setup-packer@1aa358be5cf73883762b302a3a03abd66e75b232 #v3.1.0

- name: Initialize Packer
run: packer init .
run: |
for file in $(find . -name '*.pkr.hcl'); do
echo "Initializing $file"
packer init $file || exit 1
done
working-directory: orka/templates

- name: Validate Packer templates
Expand All @@ -35,10 +39,13 @@ jobs:
SSH_TEST_PASSWORD: 'mock-ssh-test-password'
SSH_TEST_PUBLIC_KEY: 'mock-ssh-test-public-key'
run: |
packer validate -var "orka_endpoint=$ORKA_ENDPOINT" \
-var "orka_auth_token=$ORKA_AUTH_TOKEN" \
-var "ssh_default_username=$SSH_DEFAULT_USERNAME" \
-var "ssh_default_password=$SSH_DEFAULT_PASSWORD" \
-var "ssh_test_public_key=$SSH_TEST_PASSWORD" \
-var "ssh_userssh_test_passwordname=$SSH_TEST_PUBLIC_KEY" .
for file in $(find . -name '*.pkr.hcl'); do
echo "Validating $file"
packer validate -var "orka_endpoint=$ORKA_ENDPOINT" \
-var "orka_auth_token=$ORKA_AUTH_TOKEN" \
-var "ssh_default_username=$SSH_DEFAULT_USERNAME" \
-var "ssh_default_password=$SSH_DEFAULT_PASSWORD" \
-var "ssh_test_public_key=$SSH_TEST_PUBLIC_KEY" \
-var "ssh_test_password=$SSH_TEST_PASSWORD" $file || exit 1
done
working-directory: orka/templates
12 changes: 0 additions & 12 deletions orka/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ You need to load the environment variables:

## Validate the template

You can validate all the templates by running the following command:

```shell
packer validate -var "orka_endpoint=$ORKA_ENDPOINT" -var "orka_auth_token=$ORKA_AUTH_TOKEN" -var "ssh_default_username=$SSH_DEFAULT_USERNAME" -var "ssh_default_password=$SSH_DEFAULT_PASSWORD" -var "ssh_test_password=$SSH_TEST_PASSWORD" -var "ssh_test_puclic_key=$SSH_TEST_PUBLIC_KEY" .
```

You can validate a specific template by running the following command:

```shell
Expand All @@ -60,12 +54,6 @@ packer validate -var "orka_endpoint=$ORKA_ENDPOINT" -var "orka_auth_token=$ORKA_

## Build the image

You can build all the templates by running the following command:

```shell
packer build -var "orka_endpoint=$ORKA_ENDPOINT" -var "orka_auth_token=$ORKA_AUTH_TOKEN" -var "ssh_default_username=$SSH_DEFAULT_USERNAME" -var "ssh_default_password=$SSH_DEFAULT_PASSWORD" -var "ssh_test_password=$SSH_TEST_PASSWORD" -var "ssh_test_puclic_key=$SSH_TEST_PUBLIC_KEY" .
```

You can build a specific template by running the following command:

```shell
Expand Down
55 changes: 51 additions & 4 deletions orka/templates/macos-13-arm-test.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
variable "orka_endpoint" {
type = string
default = ""
}

variable "orka_auth_token" {
type = string
default = ""
}

variable "ssh_default_username" {
type = string
default = ""
}

variable "ssh_default_password" {
type = string
default = ""
}

variable "ssh_test_public_key" {
type = string
default = ""
}

variable "ssh_test_password" {
type = string
default = ""
}

packer {
required_plugins {
macstadium-orka = {
version = "~> 3.0"
source = "github.com/macstadium/macstadium-orka"
}
}
}

source "macstadium-orka" "macos13-arm-test-image" {
source_image = "macos13-arm-base.orkasi"
image_name = "macos13-arm-test-latest.orkasi"
Expand Down Expand Up @@ -64,21 +103,29 @@ build {
"/opt/homebrew/bin/brew doctor || true"
]
}
// Install dependencies using Homebrew.
// Install dependencies for build and test.
provisioner "shell" {
inline = [
"echo 'Installing packages using Homebrew...'",
"eval \"$(/opt/homebrew/bin/brew shellenv)\"",
"/opt/homebrew/bin/brew install git automake bash libtool cmake python ccache"
]
}

// Install Java 17 for Jenkins.
provisioner "shell" {
inline = [
"echo 'Installing JRE...'",
"eval \"$(/opt/homebrew/bin/brew shellenv)\"",
"/opt/homebrew/bin/brew install --cask temurin@17",
]
}
// Print the version of the installed packages.
provisioner "shell" {
inline = [
"echo 'Printing the version of the installed packages...'",
"eval \"$(/usr/local/bin/brew shellenv)\"",
"/opt/homebrew/bin/brew list --versions"
"eval \"$(/opt/homebrew/bin/brew shellenv)\"",
"/opt/homebrew/bin/brew list --versions",
"java -version"
]
}
}
52 changes: 50 additions & 2 deletions orka/templates/macos-13-intel-test.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
variable "orka_endpoint" {
type = string
default = ""
}

variable "orka_auth_token" {
type = string
default = ""
}

variable "ssh_default_username" {
type = string
default = ""
}

variable "ssh_default_password" {
type = string
default = ""
}

variable "ssh_test_public_key" {
type = string
default = ""
}

variable "ssh_test_password" {
type = string
default = ""
}

packer {
required_plugins {
macstadium-orka = {
version = "~> 3.0"
source = "github.com/macstadium/macstadium-orka"
}
}
}

source "macstadium-orka" "macos13-intel-test-image" {
source_image = "macos13-intel-base.img"
image_name = "macos13-intel-test-latest.img"
Expand Down Expand Up @@ -63,20 +102,29 @@ build {
"/usr/local/bin/brew doctor || true"
]
}
// Install dependencies using Homebrew.
// Install dependencies for build and test.
provisioner "shell" {
inline = [
"echo 'Installing packages using Homebrew...'",
"eval \"$(/usr/local/bin/brew shellenv)\"",
"/usr/local/bin/brew install git automake bash libtool cmake python ccache"
]
}
// Install Java 17 for Jenkins.
provisioner "shell" {
inline = [
"echo 'Installing JRE...'",
"eval \"$(/usr/local/bin/brew shellenv)\"",
"/usr/local/bin/brew install --cask temurin@17",
]
}
// Print the version of the installed packages.
provisioner "shell" {
inline = [
"echo 'Printing the version of the installed packages...'",
"eval \"$(/usr/local/bin/brew shellenv)\"",
"/usr/local/bin/brew list --versions"
"/usr/local/bin/brew list --versions",
"java -version"
]
}
}
8 changes: 0 additions & 8 deletions orka/templates/plugins.pkr.hcl

This file was deleted.

29 changes: 0 additions & 29 deletions orka/templates/variables.pkr.hcl

This file was deleted.