You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* ansible: add new uncompromised smartos hosts
* orka: update base image and image name for osx13 arm test image
* orka: configure image to allow sudo without password prompting
* orka: set system hostname
* orka: allow pubkey authentication with ssh
* orka: add pipx, orka-vm-tools, and tap2junit. Ensure arm homebrew can run older scripts that expect intel homebrew paths
* orka: add ccache configuration
* ansible: add host entry for node-www
* orka: update README.md with updated documentation
* orka: add orkaconnect.sh utility script
* orka: add the packer templates for release and test
* orka: ignore secrets
* orka: add files for packer
* orka: extraneous data in old file
* orka: remove old hcl templates, update github workflow
* orka: add dummy secret files for the workflow
@@ -10,7 +10,7 @@ Once installed, you can verify the installation by running the following command
10
10
packer --version
11
11
```
12
12
13
-
While writing this document, the latest version of Packer is `1.11.2`.
13
+
While writing this document, the latest version of Packer is `1.14.2`.
14
14
15
15
## Install dependencies
16
16
@@ -22,42 +22,65 @@ packer init .
22
22
23
23
## Access the Orka environment
24
24
25
-
You need to connect to the Orka VPN. You can find the instructions in the secrets repository.
25
+
1. You need to connect to the Orka VPN. You can find the instructions in the secrets repository. @TODO
26
+
2. Authenticate the cluster with `orka3 login` -> this will give a url to access to login to macstadium. This login lasts for 3600s.
27
+
3. Once logged into macstadium, you can `orka3 user get-token` to get a user token to do other things, like build images.
26
28
27
-
## Load the environment variables
29
+
## Authenticate to ghcr.io
28
30
29
-
You need to load the environment variables:
31
+
Some Macstadium base images are stored at ghcr.io (github's container registry). To allow packer to seamlessly pull
32
+
those images, you must provide the orka3 cli with a github personal access token (PAT). See [here]https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic
1. Get the `.env` file from the secrets repository. You will find the instructions in the repository.
32
-
2. Copy the `.env` file to this directory.
33
-
3. Run the following command:
34
-
```shell
35
-
source .env
36
-
```
37
-
4. Verify that the environment variables are loaded by running the following command:
38
-
```shell
39
-
echo$ORKA_ENDPOINT
40
-
echo$ORKA_AUTH_TOKEN
41
-
echo$SSH_DEFAULT_USERNAME
42
-
echo$SSH_DEFAULT_PASSWORD
43
-
echo$SSH_TEST_PASSWORD
44
-
echo$SSH_TEST_PUBLIC_KEY
45
-
```
37
+
## Load the build variables
38
+
39
+
You need to configure the variables.auto.pkrvars.hcl file
40
+
41
+
1. Get the `orka.variables.auto.pkrvars.hcl` file from the secrets repository. There is one in release, and one in test
42
+
2. Copy the `orka.variables.auto.pkrvars.hcl` to `variables.auto.pkrvars.hcl` file to this directory.
43
+
44
+
## Load the file secrets
45
+
46
+
We need the private key for node-www for the release images, as well as the apple developer certificate for code signing.
47
+
48
+
1. Copy the `secrets/build/release/staging_id_rsa_private.key` to orka/templates/files/secrets/id_rsa
49
+
2. Go to the `build/release` folder in the secrets repo
50
+
3. Extract from secrets/build/release and put it in this repo (adjust the orka path in this command): `dotgpg cat Apple\ Developer\ ID\ Node.js\ Foundation.p12.base64 | base64 -D > orka/templates/files/secrets/Apple\ Developer\ ID\ Node.js\ Foundation.p12`
51
+
52
+
## Download Xcode to the shared vm storage
53
+
54
+
1. Full Xcode installation
55
+
56
+
Xcode Command-line tools are not enough to perform a full notarization cycle, full Xcode must be fully installed on the release images.
57
+
58
+
* Login to https://developer.apple.com using the [email protected] account
59
+
* Download Xcode: https://developer.apple.com/download/more/ - find non-beta version, open Developer Tools in browser, Networking tab, start download (then cancel), in Networking tab "Copy as cURL" (available in Chrome & FF)
60
+
* On OSX 15 we currently install 16.4
61
+
* Manually launch one of the existing VM's (Arm ones are faster)
62
+
*`orka3 images list` to see available images
63
+
*`orka3 vm deploy --image IMAGE_NAME` to deploy a new image
64
+
* NOTE: don't try to connect to an existing image as jenkins may delete it while you're working on it.
65
+
* Connect to the VM with ssh, and navigate to /Volumes/orka/Xcode
66
+
* use orkaconnect.sh VM_NAME (ie. `orkaconnect.sh vm-h1tcv`)
67
+
* Execute the curl command to download Xcode, save it to a file named Xcode_{VERSION}.xip i.e. Xcode_16.4.xip
68
+
* This is where packer will look when installing xcode in the image.
46
69
47
70
## Validate the template
48
71
49
-
You can validate a specific template by running the following command:
72
+
You can validate a specific template by running the following command (replace test with release if doing release images)
ORKA_AUTH_TOKEN=$(orka3 user get-token) packer build -var-file=variables.auto.pkrvars.hcl macos-test.pkr.hcl
61
84
```
62
85
63
86
## Continuous Integration
@@ -70,6 +93,8 @@ We don't plan to build the images in the CI pipeline. The images are built manua
70
93
71
94
Orka provides a base image that we need to customize to our needs.
72
95
96
+
Note that orka3 remote-image command is only for interacting with x64 images. arm64 images are at ghcr.io: https://github.com/macstadium/orka-images
97
+
73
98
1. find the image that you want to extend by running the following command:
74
99
```shell
75
100
orka3 remote-image list
@@ -95,130 +120,3 @@ Orka provides a base image that we need to customize to our needs.
95
120
orka3 vm delete <vm_name>
96
121
```
97
122
Note: Don't delete the vm until you have saved the image, check by running the command`orka3 image list`
98
-
99
-
100
-
101
-
### Manual Steps for all the images
102
-
103
-
1. Update Sudoers file:
104
-
105
-
this requires `NOPASSWD` to be added to the sudoers file to enable elevation
106
-
107
-
`sudo visudo`
108
-
and change:
109
-
`%admin ALL = (ALL) ALL`
110
-
to
111
-
`%admin ALL = (ALL) NOPASSWD:ALL`
112
-
113
-
2. Allow ssh access
114
-
115
-
```bash
116
-
sudo systemsetup -setremotelogin on
117
-
```
118
-
3. Install xcode
119
-
120
-
```bash
121
-
sudo xcode-select --install
122
-
```
123
-
124
-
Do a an update using the UI. Check the available updates and install them (click in "more info"). Note that you don't want to update the OS, just the software.
125
-
126
-
### Manual Steps for the release images
127
-
128
-
1. Full Xcode installation
129
-
130
-
Xcode Command-line tools are not enough to perform a full notarization cycle, full Xcode must be installed manually.
131
-
132
-
As root:
133
-
134
-
* Download Xcode: https://developer.apple.com/download/more/ - find non-beta version, open Developer Tools in browser, Networking tab, start download (then cancel), in Networking tab "Copy as cURL" (available in Chrome & FF)
135
-
* On OSX 13 we currently install 14.13.1.
136
-
* Go to downloads folder, decompress the xip file (double click) and delete the xip file
137
-
* Move the Xcode.app to /Applications
138
-
* Open xcode, accept the license, install the built-in components and close xcode
0 commit comments