-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added native driver and redesigned the image management logic (#46)
Besides adding the new Native driver for MacOS this change also changes the image definition process of the VMX and Docker drivers. * Native driver was added! It's as usual supports only macos for now, but adding to the other systems should not be so hard. It uses the node description to get the identifiers (configurable) which should be used by the Labels to find the appropriate fish node to execute on. * **BREAKING**: VMX and Docker now uses a bit different way to specify the Label definition images, so the Labels need to be updated. But as an advantage now it supports checksum to verify the image! * Added node filter and node identifiers for easy selecting where to execute the workload. It's common for all the drivers so can be used for VMX to run macos on macos or to run arm64 on arm64. * Switched examples to YAML representation - now it's readability is better * A number of fixes: * Fixed AWS startup issue - messed up gt with lt as usual * Replaced ioutil usage since deprecated as of go v1.16 * Replaced all `interface{}` to `any` * Fixed YAML user interface introduced in #48 - now it properly handled * Added UID references validation, previously they was handled automatically but after migration from dqlite that was lost
- Loading branch information
Showing
69 changed files
with
2,630 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/sh -e | ||
# Copyright 2023 Adobe. All rights reserved. | ||
# This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. You may obtain a copy | ||
# of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software distributed under | ||
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
# OF ANY KIND, either express or implied. See the License for the specific language | ||
# governing permissions and limitations under the License. | ||
|
||
# | ||
# This example script allows to see the existing Label and create a new version of it | ||
# Please check the images URLs in Label definitions below | ||
# | ||
|
||
token=$1 | ||
[ "$token" ] || exit 1 | ||
hostport=$2 | ||
[ "$hostport" ] || hostport=localhost:8001 | ||
|
||
label=mac12_native | ||
|
||
# It's a bit dirty, but works for now - probably better to create API call to find the latest label | ||
curr_label=$(curl -s -u "admin:$token" -k "https://$hostport/api/v1/label/?filter=name=\"$label\"" | sed 's/},{/},\n{/g' | tail -1) | ||
curr_version="$(echo "$curr_label" | grep -o '"version": *[0-9]\+' | tr -dc '0-9')" | ||
echo "Current label '$label:$curr_version': $curr_label" | ||
|
||
[ "x$curr_version" != "x" ] || curr_version=0 | ||
new_version=$(($curr_version+1)) | ||
|
||
echo | ||
echo "Create the new version of Label '$label:$new_version' ?" | ||
echo "Press any key to create or Ctrl-C to abort" | ||
read w1 | ||
|
||
label_id=$(curl -s -u "admin:$token" -k -X POST -H 'Content-Type: application/yaml' -d '--- | ||
name: "'$label'" | ||
version: '$new_version' | ||
definitions: | ||
- driver: native | ||
options: | ||
images: # For test purposes images are used as symlink to aquarium-bait/out so does not need checksum | ||
- url: https://artifact-storage/aquarium/image/native/mac/mac-VERSION.tar.xz | ||
tag: ws | ||
- url: https://artifact-storage/aquarium/image/native/mac-ci/mac-ci-VERSION.tar.xz | ||
tag: ws | ||
groups: | ||
- staff | ||
entry: "{{ .Disks.ws }}/init.sh" | ||
resources: | ||
node_filter: | ||
- OS:darwin | ||
- OSVersion:12.* | ||
- Arch:x86_64 | ||
cpu: 4 | ||
ram: 8 | ||
disks: | ||
ws: | ||
size: 10 | ||
network: Name:test-vpc | ||
metadata: | ||
JENKINS_AGENT_WORKSPACE: "{{ .Disks.ws }}" | ||
' "https://$hostport/api/v1/label/" | grep -o '"UID": *"[^"]\+"' | cut -d':' -f 2 | tr -d ' "') | ||
|
||
echo "Created Label ID: ${label_id}" |
Oops, something went wrong.