brianloss commented on PR #3093:
URL: https://github.com/apache/accumulo/pull/3093#issuecomment-1329751603

   > Interesting, I didn't realize that installing Thrift as part of the build 
was an option. I'd like to see Brian's codespace example too.
   
   I pushed a codespaces test to my fork in the codespaces branch. If you 
navigate [here](https://github.com/brianloss/accumulo/tree/codespaces), you 
should see a "Open in GitHub Codespaces" button in the Building section of the 
readme. You can click on that to launch the codespace. You can also expand the 
Code button and click the Codespaces tab to play around there. In the terminal 
window in your codespace you can execute mvn commands to build the source. You 
can edit files and push changes back to the repo, or even re-configure and 
rebuild the codespace itself.
   
   There are a number of ways to do things, but I ended up creating two 
codespace configurations: one to build an image with thrift, java, maven, etc 
and another as the repo codespace configuration (it effectively just uses the 
image). The main reason I did that is to publish an image to the GH container 
registry for the main codespace to use. I could have also looked into 
[prebuilds](https://docs.github.com/en/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds),
 but having an image also gives something that could be used on a runner at 
build time.
   
   The main repo codespace configuration (the one that is used when you create 
a codespace) is 
[here](https://github.com/brianloss/accumulo/tree/codespaces/.devcontainer). 
The image it references (currently 
ghcr.io/brianloss/accumulo/build-devcontainer) is built from the codespace 
configuration 
[here](https://github.com/brianloss/accumulo/tree/codespaces/contrib/codespaces/.devcontainer)
 using the devcontainers/ci action in a workflow, 
[here](https://github.com/brianloss/accumulo/blob/codespaces/.github/workflows/codespaces.yaml).
 I'm using the action to build and push the image, but according to [the 
docs](https://github.com/devcontainers/ci#quick-start) you could also use the 
action to run a step such as building the thrift during CI.
   
   Happy to convert this to a PR if people are interested. The main use would 
be for new developers who want a very quick way to get a working environment 
with everything required to build Accumulo and edit the source. A side-effect 
of building an image for the codespace is we can use the same environment 
during CI if needed/desired.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to