-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
COSI-17: add-dev-container-for-sodi-driver
- the container sets up minikube, s3 and iam services.
- Loading branch information
1 parent
9e51a25
commit e69f1fb
Showing
2 changed files
with
75 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/go | ||
{ | ||
"name": "Go Dev Container", | ||
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/go:1": { | ||
"version": "latest" | ||
}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"version": "latest", | ||
"moby": true | ||
}, | ||
"ghcr.io/devcontainers/features/aws-cli:1": {}, | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { | ||
"version": "1.31", | ||
"helm": "latest", | ||
"minikube": "latest" | ||
} | ||
}, | ||
"forwardPorts": [8000, 8600], | ||
"customizations": { | ||
"codespaces": { | ||
"repositories": { | ||
"scality/cloudserver": { | ||
"permissions": { | ||
"packages": "read" | ||
} | ||
}, | ||
"scality/vault": { | ||
"permissions": { | ||
"packages": "read" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"postCreateCommand": "bash .devcontainer/setup-dev-container.sh" | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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,33 @@ | ||
#!/bin/bash | ||
|
||
echo "Installing Ginkgo and Gomega..." | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
go get github.com/onsi/gomega/... | ||
|
||
# Create a KIND cluster | ||
echo "Starting Minikube..." | ||
minikube start | ||
|
||
echo "Logging into GHCR (GitHub Container Registry)..." | ||
echo "$REPOSITORY_USER_TOKEN" | docker login ghcr.io -u "$REPOSITORY_USER" --password-stdin | ||
|
||
# Navigate to the directory and prepare the environment | ||
echo "Preparing S3 and IAM log and directories..." | ||
cd .github/s3_and_iam_deployment && \ | ||
mkdir -p logs/s3 logs/iam logs/cosi_driver data/vaultdb && \ | ||
sudo chown -R vscode:vscode logs data && \ | ||
chmod -R ugo+rwx logs data && \ | ||
|
||
# Start Docker Compose for the 'iam_s3' profile | ||
echo "Deploying S3 and IAM using docker compose..." | ||
docker compose --profile iam_s3 up -d | ||
|
||
# Set Minikube's Docker environment variables | ||
eval $(minikube docker-env) | ||
|
||
# Prune Docker on Minikube's Docker Daemon | ||
echo "Pruning unused images..." | ||
docker images | ||
docker system prune -af | ||
|
||
echo "Setup complete." |