diff --git a/packages/grid/devspace.yaml b/packages/grid/devspace.yaml index 75b9dcefdb9..3cbcfa61c4e 100644 --- a/packages/grid/devspace.yaml +++ b/packages/grid/devspace.yaml @@ -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: @@ -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 diff --git a/tox.ini b/tox.ini index 9ac5fcf05bd..2ee59b796f2 100644 --- a/tox.ini +++ b/tox.ini @@ -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'