-
Notifications
You must be signed in to change notification settings - Fork 48
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
Plugins devcontainer #684
Plugins devcontainer #684
Conversation
I think it's best to keep any devContainer for the project at the root level that is suitable for working on the project as a whole. It looks like @amanji added a docker-outside-of-docker container for frontend development there. Just a note on the different docker options. docker-in-docker provides an isolated docker environment for development. docker-outside-of-docker provides a connection to the host's docker environemnt to provide a shared docker environment. Which you use depends whether you need to interact with external services also running in docker. |
Is the tradeoff as easy as that - pick one or the other? If so, I would say go with docker-outside so that docker-based external services can be easily used — von-network, redid, tails server, even a database as needed. Keep those independent and just have them running, and stop/start Traction as needed. External versions of those services couyld be used, but the mixing and matching might be tough? Definitely think the two instances of DevContainers need to be rationalized. |
yes, devcontainer should be at the top, this was mostly a PoC and then rationalize the other containers/vscode (not sure if they are used?) i can experiment with docker outside, i do run external docker services (von-network) and use that inside the devcontainer (just need to use host.docker.internal). |
The existing devContainer is just for Node for the TenantUI. Really that's just a standalone application that points at a traction instance in it's configuration. Really the Tenant UI could be it's own repository without much difference. I don't use the devcontainer for TenantUI dev (have the version of node I need locally right now) but it's a good practice to have around so people don't need to have specific Node versions locally to dev. Can do whatever is needed to try out the plugin devcontainer here. |
Deployment URLs ready for review. |
Updated docker compose startup to use askar-only |
ab74879
to
353cbcf
Compare
postgres may need to be updated - try |
also... the plugins/docker plugins/demo stuff is not nearly as configured as the stuff in scripts. so you will probably have to some re-engineering and additions if you want to run it with all those configurations. I'm assuming the addition of an env file and env vars (can that be done in vscode files?) for the startup of launch.json acapy. maybe we should also take out pylint. those classes should be in the classpath at least on a rebuild of the devcontainer. |
a2b0744
to
4a720db
Compare
4a720db
to
6635656
Compare
6635656
to
f837837
Compare
Will need to see what to do about this PR. @esune The devcontainer stuff I could not get to work, see comment above I believe from discussing with Sherman there's additional configuration or environment work or something that would need doing to be able to debug a plugin using the instructions documented above. I get the |
i don't see those messages in the Problems tab, on Mac but shouldn't really be different? also, i can launch acapy + plugins using the "Run/Debug plugin" command (launch.json) and then call the API through swagger in a browser and it acts ok (saves to the db). I don't know how you guys want to develop or what you want out of the devcontainers, so that would be for you to tweak (like if you want tenant UI started in the devcontainer, or if you want to run it externally but against plugins running in the IDE). If you've got the main branch up to date (python 3.9, acapy 0.8.x) then just torch this PR, start fresh when you have time to figure out what the team wants for developers. |
Yeah it's not the problems listing that's blocking, but that if I start out and pull this repo and open everything up following the instructions listed I get that |
just checked this PR out clean, new location on my machine. reopened in don't know what is going on with your machine, but could try the command palette: "Dev Containers: Rebuild Container without Cache". maybe that will get you back to clean? in another vscode window, opened up tenant-ui in a container, again, all built nicely. launch 'backend - run dev', then 'frontend- run dev', then 'frontend - chrome'. was able to set breakpoints in vue and in plugins and all worked fine. able to create reservations, approve etc. so db connectivity was good. the problems, i guess it depends on what files are open? anyway, if you don't need pylint, just remove it and figure out what helper plugins you want. given what is in this PR, I can debug plugins and tenant UI vue code with breakpoints in an IDE. be nice if other traction devs could try it out and see if you want to keep the PR and/or what tweaks you want/need to make. but if you guys can't get it to work or it that flow doesn't work, I'd just kill the PR. been around a while and is dead-weight if no one makes use of it. |
Add a devcontainer for running/debugging plugin source code. Signed-off-by: Jason Sherman <tools@usingtechnolo.gy>
add simple note in readme. Signed-off-by: Jason Sherman <tools@usingtechnolo.gy>
Signed-off-by: Jason Sherman <tools@usingtechnolo.gy>
f837837
to
4b2238d
Compare
Signed-off-by: Lucas ONeil <lucasoneil@gmail.com>
Ok, thanks @usingtechnology ! Yeah the devcontainer is definitely something we'd want to work with IMO so if this can work for people to get debugging going then we should pull it in for sure. I've rebased in the changes upgrading ACA-py to 0.8.3pre (from the other PR) and resolved any conflicts. The only remaining diffs here are entirely siloed to the devcontainer stuff. |
Add a devcontainer for running/debugging plugin source code.
To begin the discussion for devcontainers...
This is a Proof of Concept for running/debugging local plugin source code. I elected to place this in the
/plugins
folder as there are.devcontainer
and.vscode
directories in the root. Do we need those?To test this code out, see if it works for you.
/plugins
This will add
docker-in-docker
(self contained docker environment in the devcontainer) and will installpoetry
. I have elected topip install
to the default python for the devcontainer. We should do something to make it easier to keep devcontainer in sync with poetry. (The editor windows won't use the poetry virtual environment so it can't find the imports when you are editing the files...)Included a Run/Debug (that uses poetry!) to start up acapy with the plugins loaded. I just created specific config and compose files for the devcontainer until we decide the path forward. The compose only starts db and proxy.
To test it all out, add a breakpoint to oca_record_list method in traction_innkeeper/v1_0/oca/routes.py, open Run/Debug view, select "Run/Debug Plugin" and start/F5.
This will kick off the docker compose build/up to start db and proxy, then will run acapy + plugins from source.
Open browser to get_oca, Try it out, execute and you should hit your breakpoint in your IDE.
Once we get this stuff squared away, I think we can remove the top level poetry and change the docker images. The image that should be used for "production" can pull the plugins from github (use the PR sha or a tag). It would be nice to get a single devcontainer config that will load up (and debug?) tenant UI as well. But start with the plugins...