-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COSI-17: Add Dev Container for COSI Driver Development #12
COSI-17: Add Dev Container for COSI Driver Development #12
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
=======================================
Coverage 75.52% 75.52%
=======================================
Files 4 4
Lines 237 237
=======================================
Hits 179 179
Misses 51 51
Partials 7 7 ☔ View full report in Codecov by Sentry. |
276ff69
to
d39c1ba
Compare
"customizations": { | ||
"codespaces": { | ||
"repositories": { | ||
"scality/cloudserver": { | ||
"permissions": { | ||
"packages": "read" | ||
} | ||
}, | ||
"scality/vault": { | ||
"permissions": { | ||
"packages": "read" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"postCreateCommand": "bash .devcontainer/setup-dev-container.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are looking into with Platform enigneering why these permissions are't working yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Till then we have docker login in the script.
minikube start | ||
|
||
echo "Logging into GHCR (GitHub Container Registry)..." | ||
echo "$REPOSITORY_USER_TOKEN" | docker login ghcr.io -u "$REPOSITORY_USER" --password-stdin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these env variables being set ? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Secrets are available as ENV variables in codespaces
Change `COSI_S3_ENDPOINT` to the IP (`hostname -I | awk '{print $1}'`) of codespace instance. | ||
|
||
#### Example | ||
|
||
```bash | ||
$ hostname -I | awk '{print $1}' | ||
10.0.1.236 | ||
``` | ||
|
||
New secret file with updated `COSI_S3_ENDPOINT` | ||
|
||
``` | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: s3-secret-for-cosi | ||
namespace: default | ||
type: Opaque | ||
stringData: | ||
COSI_S3_ACCESS_KEY_ID: PBUOB68AVF39EVVAFNFL # Plain text access key, generated in the CI | ||
COSI_S3_SECRET_ACCESS_KEY: P+PK+uMB9spUc21huaQoOexqdJoV00tSnl+pc7t7 # Plain text secret key | ||
COSI_S3_ENDPOINT: http://10.0.1.236:8000 # Plain text endpoint | ||
COSI_S3_REGION: us-west-1 # Plain text region | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format: I think you could add indentation to everything under 1 as you do for 2 and 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this part as its automated.
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/go:1": { | ||
"version": "latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is using the latest go version intentional (instead of pinning the same version as in go.mod
) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intentional to use the latest, as we want to update regularly.
I can use the same as go.mod if you insist.
@@ -41,6 +41,9 @@ log_and_run echo "Deleting Bucket Class and Bucket Claim..." | |||
log_and_run kubectl delete -f cosi-examples/bucketclass.yaml || { echo "Bucket Class not found." | tee -a "$LOG_FILE"; } | |||
log_and_run kubectl delete -f cosi-examples/bucketclaim.yaml || { echo "Bucket Claim not found." | tee -a "$LOG_FILE"; } | |||
|
|||
log_and_run echo "Deleting s3-secret-for-cosi secret..." | |||
log_and_run kubectl delete secret s3-secret-for-cosi --namespace=default || { echo "Secret s3-secret-for-cosi not found." | tee -a "$LOG_FILE"; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it makes any difference, but in other kubectl
commands the scality-object-storage
namespace is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the secret is intentionally being deployed in default namespace test the rbac and COSi driver across namespaces as cosi driver reads the secrets.
d39c1ba
to
1636d3f
Compare
rebased and pushed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You have a typo in one of your commit messages (sodi instead of cosi)
After having used them, would you recommend dev containers development environment for other projects as well?
Thanks, I will edit the commit message. :) I recommend using dev containers for every repo. The main reason is that they ensure a consistent development environment for everyone. I prefer developing locally with tools like Minikube and building images on my machine. However, if someone needs to contribute in the future, setting up everything locally can take time, especially for people who don’t contribute regularly. With dev containers, contributors can quickly start working without spending time setting up the environment. In the how to guide, we specify how to run the CI and end-to-end tests using dev containers, so once I’m familiar with the tools, one can switch back to local development if needed. |
1eb8281
to
dae6da4
Compare
- the container sets up minikube, s3 and iam services.
Issue: COSI-17
dae6da4
to
c0f97c6
Compare
Generated via copilot
🎉 Dev Containers 🚀
This PR introduces a Dev Container for the Scality COSI Driver, streamlining development and testing environments. Key contributions include:
COSI-17: Add Dev Container Configuration
Updated Cleanup Script and Docker References
cleanup_cosi_resources.sh
) to properly delete COSI resources and adjust Docker container references.COSI-17: Add Dev Container Documentation
Summary 📝
The aim is to make participation easier with the introduction of Dev Container.