Skip to content
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

feat: build and run from Docker Support #103

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rajpratik71
Copy link

Build and run the generator from docker image support added.

The main aim and motivation behind doing this is, because
of a no. of different jhipster blueprints are there,
which are compatible and works with the different version of jhipster
and also might be incompatible with other blueprints or versions of jhipster.

Signed-off-by: Pratik Raj [email protected]

@joewhite101
Copy link
Contributor

This would be a quick way to create an environment where a developer could quickly start up and run the a blueprint in situations where they didn't want to, or couldn't, setup their dev env. Basically a docker image as dev env for the jhipster command. A blueprint quickstart of sorts (assuming you've got docker).

Given the Entando use case this makes a lot of sense to me for our training and getting started cases. Would allow somebody to boot up and run the blueprint without setting up a dev env.

We'll have to think about if we'd also want to recommend that they run the generated code inside the container. In that case we'd need to add some port forwarding and addressing for Keycloak and inbound traffic.

@nshaw and @w-caffiero-entando thoughts on this?

@joewhite101
Copy link
Contributor

See also:
jhipster/generator-jhipster-quarkus#102

May make more sense to extend an existing image.

@w-caffiero-entando
Copy link
Contributor

w-caffiero-entando commented Oct 6, 2020 via email

@w-caffiero-entando
Copy link
Contributor

w-caffiero-entando commented Oct 6, 2020 via email

@Rajpratik71
Copy link
Author

This would be a quick way to create an environment where a developer could quickly start up and run the a blueprint in situations where they didn't want to, or couldn't, setup their dev env. Basically a docker image as dev env for the jhipster command. A blueprint quickstart of sorts (assuming you've got docker).

Given the Entando use case this makes a lot of sense to me for our training and getting started cases. Would allow somebody to boot up and run the blueprint without setting up a dev env.

We'll have to think about if we'd also want to recommend that they run the generated code inside the container. In that case we'd need to add some port forwarding and addressing for Keycloak and inbound traffic.

@nshaw and @w-caffiero-entando thoughts on this?

Using this , approach code generation on host machine folder from generator/blueprint running in container doesn't need to forward any port and address.

After generation every generated file will remain on host system folder and container is automatically destroyed .

After , User can proceed with development and deployment of generated service by building and running using either dev or prod profile.

@nshaw
Copy link
Contributor

nshaw commented Oct 6, 2020

  1. I could see the benefits of running the tools in a container (option#2 per @w-caffiero-entando ) to avoid dependency mismatches, etc. as long as it's an option rather than something we require. I've run into a few of those issues in training, documentation tasks, etc.
  2. I would be very unlikely to want to run the IDE from inside the container though.
  3. I'm on the fence on whether the benefit of running the entire blueprint from inside the container outweighs the added complexity of supporting it. At some point we're getting into Kubernetes territory. Side note, this reminds me of the gap in our documentation re explaining our recommended/typical development environment where you spin up a blueprint and point it to an external keycloak, microservices, etc. That's not quite the same thing but related.

nshaw
nshaw previously approved these changes Oct 6, 2020
@nshaw nshaw self-requested a review October 6, 2020 20:50
@nshaw nshaw dismissed their stale review October 6, 2020 20:52

Dismissing my approval/review per Walter's clarification about the UID handling.

@w-caffiero-entando w-caffiero-entando marked this pull request as draft October 6, 2020 20:52
@Rajpratik71
Copy link
Author

Rajpratik71 commented Oct 7, 2020

Added approach and step in Readme to work with interactive shell from inside the container

@Rajpratik71
Copy link
Author

Rajpratik71 commented Oct 7, 2020

Hi Joe, To which scenario are you referring? 1. Move the entire development environment on the container 2. Use docker only for the tooks and keep the files on the user host so they can use their IDE if it's the second, I was experimenting on a command line wrapper of a jhipster-docker image (as well as the other entando-cli tools). One of the problems I had was about the UID writing the files, which is the one of the docker container's user. Sometimes you are lucky, in particular in personal systems with just one user, and the UID is 1000 for both the container and the host, sometimes your are not. So I started experimenting on docker run capabilities in order to maps the user-id, but I haven't complete my tests. Walter

On 06/10/20 11:27, Joe White wrote: This would be a quick way to create an environment where a developer could quickly start up and run the a blueprint in situations where they didn't want to, or couldn't, setup their dev env. Basically a docker image as dev env for the jhipster command. A blueprint quickstart of sorts (assuming you've got docker). Given the Entando use case this makes a lot of sense to me for our training and getting started cases. Would allow somebody to boot up and run the blueprint without setting up a dev env. We'll have to think about if we'd also want to recommend that they run the generated code inside the container. In that case we'd need to add some port forwarding and addressing for Keycloak and inbound traffic. @nshaw https://github.com/nshaw and @w-caffiero-entando https://github.com/w-caffiero-entando thoughts on this? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#103 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APFQG666OF3PRXKWKBDFFBDSJLPJDANCNFSM4SFU3SLA.

Hi @w-caffiero-entando and @nshaw , I tested the UID scenario, the generated files have host machine permission .

So , there is no concern remains about UID and permissions on files generated from container.

@Rajpratik71 Rajpratik71 marked this pull request as ready for review October 7, 2020 05:17
Build and run the generator from docker image support added.

The main aim and motivation behind doing this is, because
of a no. of different jhipster blueprints are there,
which are compatible and works with the different version of jhipster
and also might be incompatible with other blueprints or versions of jhipster.

Signed-off-by: Pratik Raj <[email protected]>
@Rajpratik71
Copy link
Author

@nshaw @w-caffiero-entando can we complete this ?

@nshaw
Copy link
Contributor

nshaw commented Nov 11, 2020

Just to throw it in here, there's been a lot of work on the entando-cli tool lately (e.g. https://github.com/entando/entando-cli/blob/develop/bin/ent-jhipster) and it accomplishes some of the same goals without requiring docker, e.g. allowing switching between entando versions (and matching jhipster version), running jhipster using that version, etc. It should be ready along with Entando 6.3 which is entering QA soon. My only reservation with this PR is having too many ways to do the same thing which incurs maintenance overhead.

@w-caffiero-entando, thoughts on this PR in that light?

@w-caffiero-entando w-caffiero-entando marked this pull request as draft March 2, 2022 08:08
@w-caffiero-entando w-caffiero-entando removed their request for review July 26, 2022 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants