diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 270df82..42ccfd8 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -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: @@ -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" \ No newline at end of file + run: task buildx-and-push TAG="$IMG_TAG" diff --git a/Taskfile.yml b/Taskfile.yml index 27c19b9..943494e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -22,7 +22,7 @@ vars: N: "" T: "" P: "" - BASETAG: 0.1.0-incubating + BASETAG: 0.9.0-incubating KUBE: sh: ./detect.sh NS: "openserverless" @@ -35,9 +35,9 @@ dotenv: includes: d: taskfile: TaskfileDev.yml - t: + t: taskfile: TaskfileTest.yml - b: + b: taskfile: TaskfileBuild.yml o: taskfile: TaskfileOlaris.yml @@ -50,7 +50,7 @@ includes: aks: taskfile: clusters/aks.yml dir: clusters - lks: + lks: taskfile: clusters/lks.yml dir: clusters gke: @@ -58,7 +58,7 @@ includes: dir: clusters mik: taskfile: clusters/microk8s.yml - dir: clusters + dir: clusters k3s: taskfile: clusters/k3s.yml dir: clusters @@ -87,7 +87,7 @@ tasks: - poetry install status: - test -e $GOBIN/kopf - + env: desc: print the current environment variables cmds: @@ -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 @@ -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 @@ -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 @@ -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: @@ -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/*/__* @@ -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 @@ -418,13 +418,13 @@ 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 @@ -432,9 +432,9 @@ tasks: - 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 @@ -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 - 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 @@ -467,7 +467,7 @@ tasks: build: desc: build the operator image - cmds: + cmds: - task: install-registry - task: tag-commit-push - task: kaniko-build @@ -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 - kubectl apply -f _operator-deploy.yaml - + shell: desc: open an interactive shell in the given pod (POD=name)