Skip to content

Commit

Permalink
Merge branch 'argoproj:master' into fix-executor-permission
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepk8s authored Mar 10, 2023
2 parents 44ee58a + 9510568 commit ee10442
Show file tree
Hide file tree
Showing 64 changed files with 1,616 additions and 531 deletions.
39 changes: 4 additions & 35 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,10 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/debian/.devcontainer/base.Dockerfile

ARG VARIANT="bullseye"
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

ARG NEW_USERNAME=""
ARG HOME=""
ARG OLD_USERNAME="vscode"
ARG VSCODE_SCRIPT_VERSION=""
FROM mcr.microsoft.com/vscode/devcontainers/universal

ARG PROTOC_ZIP="protoc-3.14.0-linux-x86_64.zip"
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y apt-transport-https ca-certificates git sudo \
# use new user instead of vscode user
&& usermod -l $NEW_USERNAME -d /home/$NEW_USERNAME -m $OLD_USERNAME \
&& groupmod -n $NEW_USERNAME $OLD_USERNAME \
&& echo $NEW_USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$NEW_USERNAME \
&& chmod 0440 /etc/sudoers.d/$NEW_USERNAME \
# kubectl
&& curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list \
&& apt-get update \
&& apt-get install -y kubectl \
# protobuf
&& curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/${PROTOC_ZIP} \

RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/${PROTOC_ZIP} \
&& unzip -o ${PROTOC_ZIP} -d /usr/local bin/protoc \
&& unzip -o ${PROTOC_ZIP} -d /usr/local 'include/*' \
&& rm -f ${PROTOC_ZIP} \
&& chmod 755 /usr/local/bin/protoc \
&& chmod -R 755 /usr/local/include/ \
# k3d
&& wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash \
# go
&& bash -ec "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/$VSCODE_SCRIPT_VERSION/script-library/go-debian.sh")" -- "1.18" "/usr/local/go" "$HOME/go" "automatic" "true" "false" \
# dind
&& bash -ec "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/$VSCODE_SCRIPT_VERSION/script-library/docker-in-docker-debian.sh")" -- "true" "automatic" "true" "20.10" "v1" \
# node
&& bash -ec "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/$VSCODE_SCRIPT_VERSION/script-library/node-debian.sh")" -- "/usr/local/share/nvm" "16" "automatic" "true" "true" \
# python
&& bash -ec "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/$VSCODE_SCRIPT_VERSION/script-library/python-debian.sh")" -- "3.9" \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
&& chmod -R 755 /usr/local/include/
35 changes: 6 additions & 29 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/debian
{
"name": "Debian",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "bullseye",
"NEW_USERNAME": "${localEnv:USER}",
"HOME": "${localEnv:HOME}",
"VSCODE_SCRIPT_VERSION": "v0.234.0"
}
},

"settings": {},

"extensions": [],

"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

"remoteUser": "${localEnv:USER}",
"features": {},

"workspaceMount": "source=${localWorkspaceFolder},target=${localEnv:HOME}/go/src/github.com/argoproj/argo-workflows,type=bind",
"workspaceFolder": "${localEnv:HOME}/go/src/github.com/argoproj/argo-workflows",

"postStartCommand": "bash -i .devcontainer/startup.sh"
}
"build": { "dockerfile": "Dockerfile" },
"hostRequirements": {"cpus": 4},
"onCreateCommand": ".devcontainer/pre-build.sh",
"workspaceMount": "source=${localWorkspaceFolder},target=${localEnv:HOME}/go/src/github.com/argoproj/argo-workflows,type=bind",
"workspaceFolder": "${localEnv:HOME}/go/src/github.com/argoproj/argo-workflows"
}
13 changes: 13 additions & 0 deletions .devcontainer/pre-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -eux

# install kubernetes
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
k3d cluster get k3s-default || k3d cluster create --wait
k3d kubeconfig merge --kubeconfig-merge-default

# install kit
curl -q https://raw.githubusercontent.com/kitproj/kit/main/install.sh | sh

# do time consuming tasks, e.g. download deps and initial build
kit build
18 changes: 0 additions & 18 deletions .devcontainer/startup.sh

This file was deleted.

4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.iml
*.md
*.yaml
# The .git folder gets modified every time git runs preventing caching of builds. Once removed, we must pass GIT_COMMIT as Docker build-args.
.git
.github
.idea
.run
Expand All @@ -12,9 +14,11 @@ coverage.out
dist
docs
examples
logs
manifests
plugins
sdks
site
test/e2e
ui/dist
ui/node_modules
Expand Down
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ updates:
ignore:
- dependency-name: raw-loader
- dependency-name: style-loader
- dependency-name: react-router-dom
- dependency-name: @types/react-router-dom
open-pull-requests-limit: 10
31 changes: 21 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
TODO: Say why you made your changes.
TODO: Say what changes you made.
TODO: Say how you tested your changes.
TODO: Attach screenshots if you changed the UI.

Fixes #TODO

Please do not open a pull request until you have checked ALL of these:
<!--
Do not open a PR until you have:
* Run `make pre-commit -B` to fix codegen and lint problems (build will fail).
* [Signed-off your commits](https://github.com/apps/dco/) (otherwise the DCO check will fail).
* Used [a conventional commit message](https://www.conventionalcommits.org/en/v1.0.0/).
When you open your PR
* "Fixes #" is in both the PR title (for release notes) and this description (to automatically link and close the issue).
* Create the PR as draft.
* Once builds are green, mark your PR "Ready for review".
* [ ] Create the PR as draft .
* [ ] Run `make pre-commit -B` to fix codegen and lint problems.
* [ ] Sign-off your commits (otherwise the DCO check will fail).
* [ ] Use [a conventional commit message](https://www.conventionalcommits.org/en/v1.0.0/) (otherwise the commit message check will fail).
* [ ] "Fixes #" is in both the PR title (for release notes) and this description (to automatically link and close the issue).
* [ ] Add unit or e2e tests. Say how you tested your changes. If you changed the UI, attach screenshots.
* [ ] Github checks are green.
* [ ] Once required tests have passed, mark your PR "Ready for review".
When changes are requested, please address them and then dismiss the review to get it reviewed again.
If changes were requested, and you've made them, dismiss the review to get it reviewed again.
-->
2 changes: 0 additions & 2 deletions .github/semantic.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 8
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
cache: true
- run: make test STATIC_FILES=false GOTEST='go test -p 20 -covermode=atomic -coverprofile=coverage.out'
# engineers just ignore this in PRs, so lets not even run it
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
cache: true
- uses: actions/setup-java@v3
if: ${{matrix.test == 'test-java-sdk'}}
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
cache: true
- run: make lint STATIC_FILES=false
- run: git diff --exit-code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
python-version: 3.9
- uses: actions/setup-go@v3
with:
go-version: '1.18'
go-version: '1.19'
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "19"
# Use the same make target both locally and on CI to make it easier to debug failures.
- run: make docs
# If markdownlint fixes issues, files will be changed. If so, fail the build.
Expand Down
38 changes: 34 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,26 @@ jobs:
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
run: |
set -eux
tag=$(basename $GITHUB_REF)
if [ $tag = "master" ]; then
tag="latest"
fi
# copied verbatim from Makefile
GIT_COMMIT=$(git rev-parse HEAD || echo unknown)
GIT_TAG=$(git describe --exact-match --tags --abbrev=0 2> /dev/null || echo untagged)
GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)
tag_suffix=$(echo $PLATFORM | sed -r "s/\//-/g")
image_name="${DOCKERIO_ORG}/${TARGET}:${tag}-${tag_suffix}"

docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--build-arg GIT_COMMIT=$GIT_COMMIT \
--build-arg GIT_TAG=$GIT_TAG \
--build-arg GIT_TREE_STATE=$GIT_TREE_STATE \
--platform="${PLATFORM}" \
--target $TARGET \
--tag $image_name .
Expand All @@ -84,6 +92,9 @@ jobs:
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--build-arg GIT_COMMIT=$GIT_COMMIT \
--build-arg GIT_TAG=$GIT_TAG \
--build-arg GIT_TREE_STATE=$GIT_TREE_STATE \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .
Expand Down Expand Up @@ -137,18 +148,26 @@ jobs:
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
run: |
set -eux
tag=$(basename $GITHUB_REF)
if [ $tag = "master" ]; then
tag="latest"
fi
# copied verbatim from Makefile
GIT_COMMIT=$(git rev-parse HEAD || echo unknown)
GIT_TAG=$(git describe --exact-match --tags --abbrev=0 2> /dev/null || echo untagged)
GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)
tag_suffix=$(echo $PLATFORM | sed -r "s/\//-/g")
image_name="${DOCKERIO_ORG}/${TARGET}:${tag}-${tag_suffix}"
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--build-arg GIT_COMMIT=$GIT_COMMIT \
--build-arg GIT_TAG=$GIT_TAG \
--build-arg GIT_TREE_STATE=$GIT_TREE_STATE \
--platform="${PLATFORM}" \
--target $TARGET \
--tag $image_name .
Expand All @@ -157,6 +176,9 @@ jobs:
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
--build-arg GIT_COMMIT=$GIT_COMMIT \
--build-arg GIT_TAG=$GIT_TAG \
--build-arg GIT_TREE_STATE=$GIT_TREE_STATE \
--platform="${PLATFORM}" \
--target $TARGET \
--tag quay.io/$image_name .
Expand Down Expand Up @@ -194,7 +216,15 @@ jobs:
targets="argoexec"
for target in $targets; do
image_name="${docker_org}/${target}:${tag}-windows"
docker build --target $target -t $image_name -f Dockerfile.windows .
docker build \
--build-arg GIT_COMMIT=$tag \
--build-arg GIT_BRANCH=$branch \
--build-arg GIT_TREE_STATE=$tree_state \
--target $target \
-t $image_name \
-f Dockerfile.windows \
.
docker push $image_name
docker tag $image_name quay.io/$image_name
Expand Down Expand Up @@ -351,7 +381,7 @@ jobs:
node-version: "16"
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/cache@v3
with:
path: ui/node_modules
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ sdks/python/client/dist/*
# Do not commit rendered installation manifests since they are misleading to users.
manifests/install.yaml
manifests/namespace-install.yaml
/logs
Loading

0 comments on commit ee10442

Please sign in to comment.