Skip to content

Commit 589a451

Browse files
committed
chore: check and build pipelines
replaced poetry with uv and ops in tasks for check and build pipelines. Tests pass
1 parent b3ecd83 commit 589a451

13 files changed

Lines changed: 60 additions & 60 deletions

File tree

.github/cisetup.sh

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,31 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
19+
cd $HOME
2020
sudo apt-get -y install curl wget jq
21-
WSK_VERSION=1.2.0
22-
WSK_BASE=https://github.com/apache/openwhisk-cli/releases/download
23-
ARCH=amd64
24-
WSK_URL="$WSK_BASE/$WSK_VERSION/OpenWhisk_CLI-$WSK_VERSION-linux-$ARCH.tgz"
25-
curl -sSL https://install.python-poetry.org | python3.12 -
26-
curl -sSL "$WSK_URL" | tar xzvf - -C ~/.local/bin/
27-
VER="v4.5.4"
28-
ARCH="$(dpkg --print-architecture)"
29-
URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$VER/kustomize_${VER}_linux_${ARCH}.tar.gz"
30-
curl -sL $URL | tar tzvf - -C ~/.local/bin
31-
YQ_VER=v4.27.2
32-
YQ_BIN=yq_linux_amd64
33-
sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VER}/${YQ_BIN} -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
34-
MC_VER=RELEASE.2025-05-21T01-59-54Z
35-
sudo wget https://dl.min.io/client/mc/release/linux-${ARCH}/archive/mc.${MC_VER} -O /usr/bin/mc && sudo chmod +x /usr/bin/mc
36-
#URL="https://dl.k8s.io/release/$VER/bin/linux/$ARCH/kubectl"
37-
#curl -sSL "$URL" | sudo tee /usr/local/bin/kubectl && sudo chmod +x /usr/bin/kubectl
38-
#kubectl version
21+
# ensure local bin exists and is on PATH for this script
22+
mkdir -p "$HOME/.local/bin"
23+
export PATH="$HOME/.local/bin:$PATH"
24+
25+
# add ops bin (~/.ops/<os>-<arch>/bin). os is uname -s lowercase, map common arch names
26+
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
27+
arch="$(uname -m)"
28+
case "$arch" in
29+
x86_64) arch=amd64 ;;
30+
aarch64|arm64) arch=arm64 ;;
31+
armv7l) arch=armv7 ;;
32+
i386|i686) arch=386 ;;
33+
esac
34+
RESOLVED_OPS_BIN="$HOME/.ops/${os}-${arch}/bin"
35+
36+
# install ops, wsk wrapper and task
37+
VER="0.1.0-2501041342.dev";\
38+
URL="https://raw.githubusercontent.com/apache/openserverless-cli/refs/tags/v$VER/install.sh" ;\
39+
curl -sL $URL | VERSION="$VER" bash ;\
40+
echo -e '#!/bin/bash\nops -wsk "$@"' >$HOME/.local/bin/wsk ; chmod +x $HOME/.local/bin/wsk ;\
41+
curl -sL https://taskfile.dev/install.sh | sh -s -- -d -b $HOME/.local/bin; \
42+
task --version && ops -t
43+
44+
# Persist ops path for GitHub Actions steps
45+
echo "$RESOLVED_OPS_BIN" >> "$GITHUB_PATH"
46+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"

.github/workflows/check.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
#
1818

19-
name: openserverless-operator-check
19+
name: Check OpenServerless Operator
2020
on:
2121
push:
2222
branches: [main]
@@ -46,24 +46,21 @@ jobs:
4646
if: ${{ github.repository_owner != 'apache'}}
4747
run: |
4848
echo "MY_OPERATOR_IMAGE=${{ vars.MY_OPERATOR_IMAGE }}" >> "$GITHUB_ENV"
49-
- name: Kind
50-
uses: container-tools/kind-action@v2.0.4
51-
with:
52-
version: v0.22.0
53-
cluster_name: nuvolaris
54-
config: .github/kind.yaml
5549
- name: Set up Python 3.12
5650
uses: actions/setup-python@v4
5751
with:
5852
python-version: 3.12
5953
- name: Setup
6054
run: bash .github/cisetup.sh
55+
- name: Kind
56+
run: |
57+
cd $HOME && \
58+
ops setup docker create &&
59+
kind export kubeconfig --name nuvolaris
6160
- name: Install
6261
run: task setup
6362
- name: BuildAndLoad
6463
run: task build-and-load TAG="$IMG_TAG"
65-
- name: AddIngress
66-
run: task kind:ingress
6764
- name: Ngrok
6865
if: ${{ env.NGROK == 'on' }}
6966
run: bash .github/debug-github-actions.sh
@@ -78,4 +75,4 @@ jobs:
7875
continue-on-error: false
7976
- name: Integration Test
8077
run: task itest
81-
continue-on-error: false
78+
continue-on-error: false

.github/workflows/image.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ on:
2727
jobs:
2828
image:
2929
name: Build OpenServerless Operator Image
30-
runs-on: ubuntu-22.04
30+
#runs-on: ubuntu-22.04
31+
runs-on: [ self-hosted, Linux, X64 ]
3132
steps:
3233
- name: Remove unnecessary files
3334
run: |
3435
sudo rm -rf /usr/share/dotnet
35-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
36+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
3637
- name: Checkout
3738
uses: actions/checkout@v2
3839
with:
@@ -58,13 +59,12 @@ jobs:
5859
- name: Setup
5960
run: bash .github/cisetup.sh
6061
- name: Kind
61-
uses: container-tools/kind-action@v2.0.4
62-
with:
63-
version: v0.22.0
64-
cluster_name: nuvolaris
65-
config: .github/kind.yaml
62+
run: |
63+
cd $HOME && \
64+
ops setup docker create &&
65+
kind export kubeconfig --name nuvolaris
6666
- name: Install
67-
run: poetry install
67+
run: task setup
6868
- name: BuildAndLoad
6969
run: task build-and-load TAG="$IMG_TAG"
7070
- name: Ngrok
@@ -76,14 +76,9 @@ jobs:
7676
- name: Wait
7777
if: ${{ env.NGROK == 'on' }}
7878
run: bash .github/wait.sh
79-
- name: AddIngress
80-
run: task kind:ingress
8179
- name: Unit Test
8280
run: task utest
8381
continue-on-error: false
84-
#- name: Integration Test
85-
# run: task itest
86-
# continue-on-error: false
8782
- name: Registry login
8883
uses: docker/login-action@v3
8984
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ actions/github/webhook/common
5858
.idea/**
5959
.vscode/**
6060
profile_default/history.sqlite
61+
.venv

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ RUN \
125125
URL="https://raw.githubusercontent.com/apache/openserverless-cli/refs/tags/v$VER/install.sh" ;\
126126
curl -sL $URL | VERSION="$VER" bash ;\
127127
echo -e '#!/bin/bash\nops -wsk "$@"' >$HOME/.local/bin/wsk ; chmod +x $HOME/.local/bin/wsk ;\
128-
curl -sL https://taskfile.dev/install.sh | sh -s -- -d -b $HOME/.local/bin/task
128+
curl -sL https://taskfile.dev/install.sh | sh -s -- -d -b $HOME/.local/bin
129129

130130
# env with l
131131
ARG TARGETARCH

Taskfile.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ tasks:
8484
- configure-env
8585
cmds:
8686
- mkdir -p ~/.kube ; touch ~/.kube/config
87-
- poetry install
87+
#- poetry install
8888
status:
8989
- test -e $GOBIN/kopf
9090

@@ -234,7 +234,7 @@ tasks:
234234
- |
235235
for test in nuvolaris/{{.T}}*.py
236236
do echo "*** [{{.KUBE}}] $test"
237-
poetry run python3 -m doctest $test {{.CLI_ARGS}}
237+
uv run ipython -m doctest $test {{.CLI_ARGS}}
238238
done
239239
silent: true
240240

@@ -251,7 +251,7 @@ tasks:
251251
if test -e "$test"
252252
then echo "*** [{{.KUBE}}] $test"
253253
rm -f deploy/*/kustomization.yaml deploy/*/__*
254-
if poetry run ipython $test {{.CLI_ARGS}}
254+
if uv run ipython $test {{.CLI_ARGS}}
255255
then echo "OK: $test"
256256
else echo "FAIL: $test"
257257
echo $test >>_failed.txt
@@ -284,7 +284,7 @@ tasks:
284284
- task: dtest
285285

286286
debug:
287-
- poetry run ipython profile create
287+
- uv run ipython profile create
288288
- cp test_profile.ipy ~/.ipython/profile_default/startup/
289289
- task: uitest
290290

TaskfileDev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tasks:
5151

5252
cli:
5353
cmds:
54-
- env OPERATOR_IMAGE="${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}" poetry run ipython -i profile.ipy
54+
- env OPERATOR_IMAGE="${MY_OPERATOR_IMAGE:-{{.OPERATOR_IMAGE}}}" uv run ipython -i profile.ipy
5555
env:
5656
CONTROLLER_IMAGE: "{{.CONTROLLER_IMAGE}}"
5757
CONTROLLER_TAG: "{{.CONTROLLER_TAG}}"

clusters/kind/kind.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
#
18-
# three node (two workers) cluster config
18+
# two node (two workers) cluster config
1919
kind: Cluster
2020
apiVersion: kind.x-k8s.io/v1alpha4
2121
nodes:
2222
- role: control-plane
2323
- role: worker
24-
- role: worker

clusters/kind/opsfile.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
version: '3'
1919

2020
vars:
21-
NAME: "nuvolaris-dev"
21+
NAME: "nuvolaris"
2222
KUBEFILE: "{{.OPS_TMP}}/kind-dev.kubeconfig"
2323
DRY: ""
2424

@@ -36,7 +36,12 @@ tasks:
3636
- kind get kubeconfig --name="{{.NAME}}" >{{.KUBEFILE}}
3737
- cp "{{.KUBEFILE}}" "$OPS_TMP/kubeconfig"
3838
- kubectl --namespace=ingress-nginx --kubeconfig "{{.KUBEFILE}}" apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
39-
39+
40+
ingress:
41+
desc: temporary fix to create ingress
42+
cmds:
43+
- kubectl --namespace=ingress-nginx --kubeconfig "{{.KUBEFILE}}" apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
44+
4045
destroy:
4146
desc: destroy
4247
cmds:

opsfile.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
# under the License.
1717

1818
version: '3'
19-
# Licensed to the Apache Software Foundation (ASF) under one
2019

2120
vars:
2221
OS: '{{OS}}'
2322
ARCH: '{{ARCH}}'
2423

2524
tasks:
2625

27-
setup:
26+
setup-env:
2827
silent: true
2928
desc: setup the environment
3029
cmds:

0 commit comments

Comments
 (0)