-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable Codespaces with
kit
(#10532)
Signed-off-by: Alex Collins <alex_collins@intuit.com> Signed-off-by: Alex Collins <alexec@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
134 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
apiVersion: kit/v1 | ||
kind: Tasks | ||
metadata: | ||
annotations: | ||
help: | | ||
Install `kit` by following https://github.com/alexec/kit#install. | ||
Run `kit up` to start argo. | ||
- `env PROFILE=mysql kit up` to start with MySQL. | ||
- `env PROFILE=plugins ARGO_EXECUTOR_PLUGINS=true kit up` to start with plugins. | ||
- `env PROFILE=sso ARGO_AUTH_MODE=sso kit up` to start with SSO. | ||
The app will be up-and-running between 15s and 1m later (if hot compiled or cold). | ||
Any changes made to the source code will be automatically recompiled and the app restarted, typically within a few seconds. | ||
name: argo-workflows | ||
spec: | ||
tasks: | ||
- name: go-deps | ||
command: go mod download | ||
mutex: deps | ||
- name: static-files | ||
command: make server/static/files.go STATIC_FILES=false | ||
dependencies: go-deps | ||
- command: go build -v ./... | ||
name: go-build | ||
dependencies: static-files go-deps | ||
- name: cluster-info | ||
command: kubectl cluster-info | ||
- name: docker-ps | ||
command: docker ps | ||
- name: install | ||
command: sh -c "make install PROFILE=$PROFILE" | ||
env: | ||
- PROFILE=minimal | ||
dependencies: cluster-info go-deps | ||
watch: manifests | ||
- command: make ./dist/workflow-controller | ||
dependencies: go-build | ||
name: build-controller | ||
- name: port-forward | ||
command: ./hack/port-forward.sh | ||
ports: 9000 | ||
dependencies: install | ||
- name: controller | ||
command: ./dist/workflow-controller | ||
dependencies: install build-controller port-forward | ||
env: | ||
- ARGO_EXECUTOR_PLUGINS=false | ||
- ARGO_NAMESPACE=argo | ||
- ARGO_NAMESPACED=true | ||
- ARGO_MANAGED_NAMESPACE=argo | ||
- ARGO_LOG_LEVEL=info | ||
- ARGO_REMOVE_PVC_PROTECTION_FINALIZER=true | ||
- ARGO_PROGRESS_PATCH_TICK_DURATION=7s | ||
- DEFAULT_REQUEUE_TIME=1s | ||
- LEADER_ELECTION_IDENTITY=local | ||
- ALWAYS_OFFLOAD_NODE_STATUS=false | ||
- OFFLOAD_NODE_STATUS_TTL=30s | ||
- WORKFLOW_GC_PERIOD=30s | ||
- UPPERIO_DB_DEBUG=1 | ||
- ARCHIVED_WORKFLOW_GC_PERIOD=30s | ||
ports: "9090" | ||
watch: cmd/workflow-controller config errors persist pkg util workflow | ||
- name: build-argo | ||
command: make ./dist/argo | ||
dependencies: go-build | ||
env: | ||
- STATIC_FILES=false | ||
watch: cmd/argo config errors persist pkg util server workflow | ||
- name: server | ||
command: ./dist/argo server | ||
dependencies: build-argo controller port-forward | ||
env: | ||
- ARGO_X_FRAME_OPTIONS=SAMEORIGIN | ||
- ARGO_SECURE=false | ||
- ARGO_NAMESPACE=argo | ||
- ARGO_NAMESPACED=true | ||
- ARGO_LOG_LEVEL=info | ||
- ARGO_AUTH_MODE=hybrid | ||
- ARGO_MANAGED_NAMESPACE=argo | ||
- UPPERIO_DB_DEBUG=1 | ||
ports: "2746" | ||
- name: ui-deps | ||
command: yarn --cwd ui install | ||
mutex: deps | ||
- name: ui-build | ||
command: yarn --cwd ui build | ||
dependencies: ui-deps | ||
- name: ui | ||
command: yarn --cwd ui start | ||
dependencies: ui-deps server | ||
ports: "8080" | ||
- name: executor | ||
command: make argoexec-image | ||
dependencies: docker-ps | ||
watch: cmd/argoexec config errors pkg util workflow | ||
- name: example | ||
command: kubectl create -f examples/hello-world.yaml | ||
dependencies: controller | ||
- name: build | ||
dependencies: build-controller build-argo ui-build | ||
- name: up | ||
dependencies: controller server executor ui example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters