apisix icon indicating copy to clipboard operation
apisix copied to clipboard

chore: Add devcontainer to ease out for contributors

Open jaysonsantos opened this issue 3 years ago • 9 comments

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)

jaysonsantos avatar Aug 30 '22 13:08 jaysonsantos

@nic-6443 could you approve again so the markdown linter runs again?

jaysonsantos avatar Aug 31 '22 12:08 jaysonsantos

@nic-6443 could you approve again so the markdown linter runs again?

ok.

nic-6443 avatar Aug 31 '22 14:08 nic-6443

@nic-6443 i've added the missing licenses

jaysonsantos avatar Aug 31 '22 18:08 jaysonsantos

CI error: https://github.com/apache/apisix/runs/8125739733?check_suite_focus=true

tzssangglass avatar Sep 01 '22 11:09 tzssangglass

@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

jaysonsantos avatar Sep 01 '22 13:09 jaysonsantos

@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

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.

tzssangglass avatar Sep 01 '22 17:09 tzssangglass

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.

soulbird avatar Sep 07 '22 02:09 soulbird

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

membphis avatar Sep 07 '22 06:09 membphis

@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).

jaysonsantos avatar Sep 12 '22 15:09 jaysonsantos

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.

github-actions[bot] avatar Nov 20 '22 10:11 github-actions[bot]

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.

github-actions[bot] avatar Dec 18 '22 10:12 github-actions[bot]