Skip to content
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
24 changes: 12 additions & 12 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "IMG_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
- name: Assign Custom Image Name
if: ${{ github.repository_owner != 'apache'}}
run: |
echo "MY_OPERATOR_IMAGE=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}" >> "$GITHUB_ENV"
echo "IMAGE_REGISTRY=ghcr.io" >> "$GITHUB_ENV"
#- name: Assign Custom Image Name
# if: ${{ github.repository_owner != 'apache'}}
# run: |
# echo "MY_OPERATOR_IMAGE=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}" >> "$GITHUB_ENV"
# echo "IMAGE_REGISTRY=ghcr.io" >> "$GITHUB_ENV"
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
Expand All @@ -75,16 +75,16 @@ jobs:
# run: task itest
# continue-on-error: false
- name: Registry login
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ${{ env.IMAGE_REGISTRY || 'registry.hub.docker.com' }}
username: ${{ env.IMAGE_REGISTRY == 'ghcr.io' && github.repository_owner || secrets.DOCKERHUB_USER }}
password: ${{ env.IMAGE_REGISTRY == 'ghcr.io' && secrets.GITHUB_TOKEN || secrets.DOCKERHUB_TOKEN }}
registry: 'docker.io'
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
with:
image: tonistiigi/binfmt:qemu-v7.0.0-28
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Image
run: task buildx-and-push TAG="$IMG_TAG"
run: task buildx-and-push TAG="$IMG_TAG"
46 changes: 23 additions & 23 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vars:
N: ""
T: ""
P: ""
BASETAG: 0.1.0-incubating
BASETAG: 0.9.0-incubating
KUBE:
sh: ./detect.sh
NS: "openserverless"
Expand All @@ -35,9 +35,9 @@ dotenv:
includes:
d:
taskfile: TaskfileDev.yml
t:
t:
taskfile: TaskfileTest.yml
b:
b:
taskfile: TaskfileBuild.yml
o:
taskfile: TaskfileOlaris.yml
Expand All @@ -50,15 +50,15 @@ includes:
aks:
taskfile: clusters/aks.yml
dir: clusters
lks:
lks:
taskfile: clusters/lks.yml
dir: clusters
gke:
taskfile: clusters/gke.yml
dir: clusters
mik:
taskfile: clusters/microk8s.yml
dir: clusters
dir: clusters
k3s:
taskfile: clusters/k3s.yml
dir: clusters
Expand Down Expand Up @@ -87,7 +87,7 @@ tasks:
- poetry install
status:
- test -e $GOBIN/kopf

env:
desc: print the current environment variables
cmds:
Expand Down Expand Up @@ -231,7 +231,7 @@ tasks:
desc: "[deprecated] generate and force a new git tag based on the current time"
cmds:
- git tag -d $(git tag)
- git tag -f {{.P}}{{.BASETAG}}.$(date +%y%m%d%H%M)
- git tag -f {{.P}}{{.BASETAG}}.$(date +%y%m%d%H%M)-SNAPSHOT
- env PAGER= git tag

# configure env
Expand All @@ -248,7 +248,7 @@ tasks:
desc: update configuration files copied from the openwhisk source repo
ignore_error: true
cmds:
- |
- |
cp -v ../openserverless/openserverless-controller/openwhisk/ansible/files/*.json openserverless/files
cp -v ../openserverless/openserverless-controller/openwhisk/bin/wskadmin tools/cli/wsk/wskadmin.py
cp -v ../openserverless/openserverless-controller/openwhisk/tools/admin/*.py tools/cli/wsk
Expand All @@ -275,7 +275,7 @@ tasks:
- cmd: kubectl -n openserverless delete kubegres --timeout=60s
ignore_error: true
- cmd: kubectl -n openserverless delete milvus --timeout=60s
ignore_error: true
ignore_error: true
- cmd: kubectl -n openserverless delete wsk/controller --grace-period=0 --timeout=5s
ignore_error: true
- cmd: task defin
Expand All @@ -289,7 +289,7 @@ tasks:
- cmd: kubectl -n openserverless delete cm/config --grace-period=0
ignore_error: true
- cmd: kubectl delete clusterissuers/letsencrypt-issuer
ignore_error: true
ignore_error: true


utest:
Expand All @@ -315,7 +315,7 @@ tasks:
kubectl apply -f deploy/openserverless-permissions
rm -f _failed.txt
for test in tests/{{.T}}*.ipy tests/{{.KUBE}}/{{.T}}*.ipy
do
do
if test -e "$test"
then echo "*** [{{.KUBE}}] $test"
rm -f deploy/*/kustomization.yaml deploy/*/__*
Expand Down Expand Up @@ -390,7 +390,7 @@ tasks:
then echo "*** current: {{.KUBE}}"
ls clusters/*.kubeconfig | sort | awk '{ print NR, $0 }'
echo "*** select with 'task #'"
else CFG="$(ls -1 clusters/*.kubeconfig | tail +{{.N}} | head -1)"
else CFG="$(ls -1 clusters/*.kubeconfig | tail +{{.N}} | head -1)"
cp $CFG ~/.kube/config
echo "cluster: $(./detect.sh)"
kubectl get nodes
Expand Down Expand Up @@ -418,23 +418,23 @@ tasks:
- task: b:docker-login

# openserverless-operator section
tag:
tag:
silent: true
desc: generate a new tag based on the current time
desc: generate a new tag based on the current time
cmds:
- git tag -d $(git tag) || true
- git tag -f {{.BASETAG}}.$(date +%y%m%d%H%M)
- env PAGER= git tag
- env PAGER= git tag

install-registry:
desc: install a local registry
cmds:
- sudo cp registries.yaml /etc/rancher/k3s/registries.yaml
- sudo systemctl restart k3s
- helm repo add twuni https://helm.twun.io
- >
helm install docker-registry twuni/docker-registry
--namespace kube-system
- >
helm install docker-registry twuni/docker-registry
--namespace kube-system
--set image.tag=2.8.3
--set service.type=NodePort
--set service.nodePort=30050
Expand All @@ -451,14 +451,14 @@ tasks:
kaniko-build:
desc: build in current kubernetes with Kaniko
env:
TAG:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || echo latest
cmds:
- test -n "$GITHUB_USER" || true "did you configure your .env?"
- envsubst <kaniko-build.yaml >_kaniko-build.yaml
- kubectl -n default delete job/kaniko-build || true
- kubectl -n default apply -f _kaniko-build.yaml
- kubectl wait po --for=condition=ready -l app=kaniko-build -n default
- kubectl wait po --for=condition=ready -l app=kaniko-build -n default

build-logs:
desc: show logs of the latest build
Expand All @@ -467,7 +467,7 @@ tasks:

build:
desc: build the operator image
cmds:
cmds:
- task: install-registry
- task: tag-commit-push
- task: kaniko-build
Expand All @@ -476,12 +476,12 @@ tasks:
deploy:
desc: deploy the current operator image
env:
TAG:
TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || echo latest
cmds:
- envsubst <operator-deploy.yaml >_operator-deploy.yaml
- kubectl apply -f _operator-deploy.yaml


shell:
desc: open an interactive shell in the given pod (POD=name)
Expand Down