Fixed references to build images (#211)
* bug fixes
* fixed operator images
* fixed taskfile
---------
Co-authored-by: Trustable User <noreply@example.com>
diff --git a/Taskfile.yml b/Taskfile.yml
index 8c40e80..563ec25 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -34,8 +34,8 @@
RUNTIMES_TAG: "{{.OPERATOR_TAG}}"
OPENSERVERLESS_TAG: "{{.OPERATOR_TAG}}"
- CONTROLLER_SRC: "docker.io/apache/openserverless-wsk-invoker:{{.OPENSERVERLESS_TAG}}"
- INVOKER_SRC: "docker.io/apache/openserverless-wsk-controller:{{.OPENSERVERLESS_TAG}}"
+ CONTROLLER_SRC: "docker.io/apache/openserverless-wsk-controller:{{.OPENSERVERLESS_TAG}}"
+ INVOKER_SRC: "docker.io/apache/openserverless-wsk-invoker:{{.OPENSERVERLESS_TAG}}"
OPS_BRANCH: "{{.OPERATOR_TAG}}"
@@ -116,8 +116,8 @@
vars:
SRC: "{{.ADMIN_API_SRC}}"
- openserverless:
- desc: build openserverless
+ openwhisk:
+ desc: build openwhisk
dir: build
env:
PATH: "{{.TASKFILE_DIR}}:$PATH"
@@ -182,13 +182,23 @@
- task: cli
- mkdir -p ~/.local/bin ~/.ops/{{.OPS_BRANCH}}
- ln -sf $(pwd)/ops ~/.local/bin/ops
- - ln -sf $(pwd)/olaris ~/.ops/{{.OPS_BRANCH}}/olaris
+ - test -d ~/.ops/{{.OPS_BRANCH}}/olaris || ln -sf $(pwd)/olaris ~/.ops/{{.OPS_BRANCH}}/olaris
+ - touch ~/.profile
+ - |
+ if ! grep -q OPS_BRANCH= ~/.profile
+ then echo export OPS_BRANCH={{.OPS_BRANCH}} >>~/.profile
+ fi
+ - |
+ if ! grep -q 'PATH=~/.local/bin' ~/.profile
+ then echo 'export PATH=~/.local/bin:"$PATH"' >>~/.profile
+ fi
+
build:
desc: build all
cmds:
- task: opslink
- - task: openserverless
+ - task: openwhisk
- task: operator
- task: runtimes
- task: streamer
@@ -212,12 +222,12 @@
desc: check license headers
cmds:
- |
- license-eye header {{.CMD}}
+ license-eye header {{.CMD}}
for i in */.licenserc.yaml
- do
+ do
DIR=$(dirname $i)
echo "*** Checking license headers in $DIR"
- cd $DIR
- license-eye header {{.CMD}}
- cd {{.TASKFILE_DIR}}
- done
+ cd $DIR
+ license-eye header {{.CMD}}
+ cd {{.TASKFILE_DIR}}
+ done
diff --git a/build b/build
index 9304559..7c97989 160000
--- a/build
+++ b/build
@@ -1 +1 @@
-Subproject commit 93045597c427a3a04c0c8912755f269dde7fe5a6
+Subproject commit 7c97989598e56be41fd5bb39e26b67183a5d210e
diff --git a/build-and-test-mac.sh b/build-and-test-mac.sh
index 3c997c5..453f664 100755
--- a/build-and-test-mac.sh
+++ b/build-and-test-mac.sh
@@ -53,32 +53,39 @@
# Path of the mounted source dir as seen inside the VM (lima mirrors the host path).
GUEST_SRC="$SRC_DIR"
-echo "Provisioning the build user (docker + passwordless sudo)"
+echo "Resolving the build user from the mount owner"
# The user that owns the mounted source already exists inside the VM (lima maps
# the host user in), so reuse it rather than creating one with a clashing uid.
-# Give it docker + passwordless sudo so the build script needs no newgrp/usermod.
-# The resolved username is written to a file we read back on the host.
-BUILD_USER="$(limactl shell "$VM_NAME" sudo env GUEST_SRC="$GUEST_SRC" bash -euo pipefail <<'PROVISION'
-# uid that owns the source files on the mount -> the user we build as.
-SRC_UID="$(stat -c %u "$GUEST_SRC")"
-BUILD_USER="$(getent passwd "$SRC_UID" | cut -d: -f1)"
-if [ -z "$BUILD_USER" ]; then
- echo "no user owns $GUEST_SRC (uid $SRC_UID)" >&2
+# Resolve it in its OWN command so nothing else can pollute the captured stdout:
+# the provisioning step below installs docker, whose installer prints to stdout,
+# and folding that into the same capture is what made BUILD_USER come back as
+# multi-line garbage (resolving to root) on first run.
+SRC_UID="$(limactl shell "$VM_NAME" stat -c %u "$GUEST_SRC")"
+BUILD_USER="$(limactl shell "$VM_NAME" getent passwd "$SRC_UID" | cut -d: -f1)"
+if [ -z "$BUILD_USER" ] || [ "$BUILD_USER" = "root" ]; then
+ echo "ERROR: could not resolve a non-root build user owning $GUEST_SRC (uid ${SRC_UID:-?})" >&2
exit 1
fi
+echo "Build user is '$BUILD_USER'"
+echo "Provisioning the build user (docker + passwordless sudo)"
+# Give it docker + passwordless sudo so the build script needs no newgrp/usermod.
+# All output goes to stderr; this block returns nothing on stdout.
+limactl shell "$VM_NAME" sudo env BUILD_USER="$BUILD_USER" bash -euo pipefail >&2 <<'PROVISION'
# Install docker and add the build user to the docker + sudo groups.
-which docker >/dev/null 2>&1 || curl -sL get.docker.com | sh >&2
+which docker >/dev/null 2>&1 || curl -sL get.docker.com | sh
usermod -aG docker,sudo "$BUILD_USER"
# Passwordless sudo.
echo "$BUILD_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/build-user
chmod 440 /etc/sudoers.d/build-user
-
-echo "$BUILD_USER"
PROVISION
-)"
-echo "Build user is '$BUILD_USER'"
+
+# usermod -aG only affects NEW logins, but lima multiplexes every `limactl shell`
+# over one persistent SSH master connection whose session predates the group add.
+# Drop that master socket so the next `limactl shell` logs in fresh and actually
+# has the docker group; otherwise `docker` calls hit a permission-denied socket.
+rm -f ~/.lima/"$VM_NAME"/ssh.sock
echo "Running $LINUX_SCRIPT inside the VM as '$BUILD_USER'"
# Run as the build user WITHOUT -i: a login shell would reset the working dir to
diff --git a/olaris b/olaris
index 56aad18..3a149de 160000
--- a/olaris
+++ b/olaris
@@ -1 +1 @@
-Subproject commit 56aad189e8315ab3499861aa1da8424cec2f516c
+Subproject commit 3a149de862fc46f515e05957a1add868c2a777a2
diff --git a/olaris-op b/olaris-op
index df1734f..7337d43 160000
--- a/olaris-op
+++ b/olaris-op
@@ -1 +1 @@
-Subproject commit df1734f73aeec561e2f2b25c363e04b897747ac3
+Subproject commit 7337d43fa7d4f16aff81c712c701805f758aa8e0