chore: Add devcontainer to ease out for contributors
Description
Hi there, first thank you very much for this project. I had a bit of trouble trying to set-up the project for local development and tried to put things in a standardize way to help onboarding new developers.
Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [x] I have updated the documentation to reflect this change
- [x] I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)
@nic-6443 could you approve again so the markdown linter runs again?
@nic-6443 could you approve again so the markdown linter runs again?
ok.
@nic-6443 i've added the missing licenses
CI error: https://github.com/apache/apisix/runs/8125739733?check_suite_focus=true
@tzssangglass how do you feel about adding something like pre-commit to add all the linters in it?
make lint does not cover eclint or the one for markdown
@tzssangglass how do you feel about adding something like pre-commit to add all the linters in it?
make lintdoes not cover eclint or the one for markdown
I'm not familiar with this, I remember we had a discussion about pre-commit. ref: https://github.com/apache/apisix/pull/3624
IMO, I think it will increase the maintenance burden. After adding it, we need to at least distinguish which files don't need to be checked.
Anyway, you can open a new issue and let's hear what others think.
I tried it and it doesn't work under Mac(Intel). I got errors like the following:
ERROR: for etcd_tls Cannot start service etcd_tls: Mounts denied:
The path /workspaces/apisix/t/certs is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.
The devcontainer is not good way for APISIX developer, it depends on Node.js, Python and C++ compiler, but APISIX do not need them.
Here is the link of devcontainer:
https://code.visualstudio.com/docs/remote/devcontainer-cli#_system-requirements
@soulbird
I tried it and it doesn't work under Mac(Intel). When does that happen? what
devcontainer build .returns? Or the problem is after it starts? IIRC, the only time it runs etcd is after create (which probably should be after attach to be honest).
@membphis those dependencies are only for the cli but does not invalidate the use of the dockerfile to install all dependencies which is a bit overwhelming for people that are just starting (in my experience at least).
the good thing is that you can open github codespaces (or vscode) with this repo, and you would have the whole setup done. but if the dependencias are too much and one does not care much about the niceties it add, a simple docker build -t apisix -f .devcontainer/Dockerfile . && docker run -w $PWD -v $PWD:$PWD -u $(id -u) -g $(id -g) apisix should drop a shell with some development capabilities out of the box (it still would miss docker in docker for the dependencies).
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions.
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.