Skip to content

Commit

Permalink
Merge pull request #8158 from OpenMined/yash/devspace-workflow
Browse files Browse the repository at this point in the history
devspace quality-of-life commands
  • Loading branch information
yashgorana authored Oct 16, 2023
2 parents 13384e8 + 5a37357 commit 82ff2f9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/grid/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ dev:
imageSelector: "${DOCKER_IMAGE_SEAWEEDFS}:${SEAWEEDFS_VERSION}"
ports:
- port: "9333" # admin
- port: "8888" # filer
- port: "8333" # S3
backend:
imageSelector: "${CONTAINER_REGISTRY}/${DOCKER_IMAGE_BACKEND}"
env:
Expand All @@ -323,6 +325,16 @@ profiles:
path: deployments.seaweedfs-config

commands:
deploy:
command: |-
devspace use context k3d-syft-dev
devspace use namespace syft
devspace deploy --var CONTAINER_REGISTRY=k3d-registry.localhost:12345
dev:
command: |-
devspace --var CONTAINER_REGISTRY=k3d-registry.localhost:12345 dev --config=devspace.yaml
devspace use context k3d-syft-dev
devspace use namespace syft
devspace dev --var CONTAINER_REGISTRY=k3d-registry.localhost:12345
contexts:
command: |-
kubectl config get-contexts
51 changes: 51 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -925,3 +925,54 @@ changedir = {toxinidir}/packages/syftcli
commands =
pip list
pytest

[testenv:dev.k8s.registry]
changedir = {toxinidir}/packages/grid
passenv=HOME,USER
allowlist_externals =
bash
commands =
bash -c 'k3d registry create registry.localhost --port 12345 -v $HOME/.k3d-registry:/var/lib/registry'
bash -c '\
CYAN="\033[1;36m"; \
CLEAR="\033[0m"; \
printf "\n${CYAN}---------------------------------------------------------\n" ;\
printf "Make sure to add the following to your /etc/hosts file:${CLEAR}\n";\
printf "127.0.0.1 k3d-registry.localhost\n";\
printf "${CYAN}---------------------------------------------------------${CLEAR}\n"'

[testenv:dev.k8s.start]
changedir = {toxinidir}/packages/grid
allowlist_externals =
bash
k3d
commands =
bash -c 'URL=http://k3d-registry.localhost:12345/v2/_catalog; \
curl -X GET $URL || (echo "ERROR: Add \"127.0.0.1 k3d-registry.localhost\" to /etc/hosts" && exit 1)'
bash -c 'k3d cluster create syft-dev -p "8080:80@loadbalancer" --registry-use k3d-registry.localhost:12345; \
k3d cluster list'

[testenv:dev.k8s.deploy]
changedir = {toxinidir}/packages/grid
passenv=HOME, USER
allowlist_externals =
bash
commands =
bash -c '\
devspace use context k3d-syft-dev; \
devspace use namespace syft; \
devspace deploy --var CONTAINER_REGISTRY=k3d-registry.localhost:12345 --config=devspace.yaml'

[testenv:dev.k8s.cleanup]
changedir = {toxinidir}/packages/grid
allowlist_externals =
bash
commands =
bash -c '\
devspace use context k3d-syft-dev; \
devspace use namespace syft; \
devspace purge; \
rm -rf .devspace; echo ""; \
k3d cluster delete syft-dev; echo ""; \
k3d registry delete registry.localhost; echo "";\
kubectl config view'

0 comments on commit 82ff2f9

Please sign in to comment.