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

Integrate Modeling Service's backend and frontend into one Docker container #2324

Open
daisuke-yoshimoto opened this Issue Jan 3, 2019 · 19 comments

Comments

@daisuke-yoshimoto
Copy link
Member

daisuke-yoshimoto commented Jan 3, 2019

Salaboy @salaboy 12月 31 2018 21:10
I was thinking that you might be able to help us in running the modeling backend with the front end all in one docker container
Daisuke Yoshimoto @daisuke-yoshimoto 12月 31 2018 21:21
@salaboy Ok.
Salaboy @salaboy 12月 31 2018 21:22
@daisuke-yoshimoto maybe creating a script and a maven profile to package the angular app with the springboot app
Daisuke Yoshimoto @daisuke-yoshimoto 12月 31 2018 21:23
https://github.com/Activiti/activiti-modeling-app
Salaboy @salaboy 12月 31 2018 21:24
That’s the frontend
So we might need a third repo where we clone both projects and package them together
Daisuke Yoshimoto @daisuke-yoshimoto 12月 31 2018 21:30
@salaboy Which is another one?
activiti-cloud-modeling
activiti-cloud-process-model-service
activiti-cloud-modeling-dependencies
activiti-cloud-modeling-build
Salaboy @salaboy 12月 31 2018 21:32
https://github.com/Activiti/activiti-cloud-modeling
Is the backend
So you need to bundle the two together into a single spring boot jar with the angular app inside
Daisuke Yoshimoto @daisuke-yoshimoto 12月 31 2018 21:32
@salaboy Ok.
@salaboy Is activiti-cloud-modeling-build not related?
Salaboy @salaboy 12月 31 2018 22:38
@daisuke-yoshimoto nope that is just the parent pom
It is true that the name is confusingly
Confusing

@daisuke-yoshimoto daisuke-yoshimoto self-assigned this Jan 3, 2019

@daisuke-yoshimoto daisuke-yoshimoto added this to the RC1 milestone Jan 3, 2019

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 4, 2019

@salaboy @igdianov
Is it okay to load the build artifacts of activiti-modeling-app (contents of the dist directory after npm run-script build command) into the Spring Boot application of activiti-cloud-modeling?

(ex) activiti-modeling-app/dist -> activiti-cloud-modeling/src/main/resources/static

@daisuke-yoshimoto daisuke-yoshimoto added this to Open in Activiti 7.x via automation Jan 4, 2019

@mteodori

This comment has been minimized.

Copy link
Member

mteodori commented Jan 4, 2019

@daisuke-yoshimoto @salaboy I have a Dockerfile that was doing that already, for the database is it going to use embedded without any need of another docker container?

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 4, 2019

@mteodori can you share that please? and yes.. embedded DB.

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 4, 2019

@mteodori @salaboy
Should I stop this issue?

@mteodori

This comment has been minimized.

Copy link
Member

mteodori commented Jan 4, 2019

I am updating the Dockerfile I have and verify, will create a PR for this ticket as soon as I have it working

@mteodori mteodori pinned this issue Jan 4, 2019

@mteodori mteodori unpinned this issue Jan 4, 2019

mteodori added a commit to mteodori/activiti-modeling-standalone that referenced this issue Jan 4, 2019

mteodori added a commit to mteodori/activiti-modeling-standalone that referenced this issue Jan 4, 2019

mteodori added a commit to mteodori/activiti-modeling-standalone that referenced this issue Jan 4, 2019

@mteodori

This comment has been minimized.

Copy link
Member

mteodori commented Jan 4, 2019

I've created an example here: https://github.com/mteodori/activiti-modeling-standalone/

The final result is not standalone though as it requires keycloak, what shall we do, disable?

Also not sure what we want to do next if to apply changes to https://github.com/activiti/activiti-modeling-app repo or create another repository like this one

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 4, 2019

@daisuke-yoshimoto @mteodori please collaborate on this one.. @daisuke-yoshimoto check @mteodori approach which is quite clever.. just overlaying two docker images..

What @daisuke-yoshimoto was trying to get working is more on the spring boot world.. which is needed to provide spring security instead of Keycloak integration. But we can solve that on the backend image only.

Next steps in my opinion:

  • Create a backend that works with Spring Security instead of going to Keycloak, this can be configured with a properties file to define a single modeler/modeler user with role ACTIVITI_MODELER
  • Do overlay as @mteodori suggested with containers to avoid moving files around
  • we can create a new repository for the aggregation, but we need to have a script to run from a pipeline so we can automate the publishing of the new standalone docker image.
@mteodori

This comment has been minimized.

Copy link
Member

mteodori commented Jan 4, 2019

I will try and find a property that disables the keycloak adapter and another that disables the spring security check and see how to change the front-end to skip the login screen as it would much less work than the above

mteodori added a commit to mteodori/activiti-modeling-standalone that referenced this issue Jan 4, 2019

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 4, 2019

@mteodori @salaboy
Thanks. I checked activiti-modeling-standalone.

I found another problem.
When transitioning to the direct URL(routing by Spring Boot) instead of the SPA transition, 404 error occurs.
2019-01-05 4 53 59

If we change the setting of Spring Boot of activiti-cloud-modeling, it seems to be resolved.
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 4, 2019

@salaboy
Is not it ok to integrate the repositories of activiti-cloud-modeling and activiti-modeling-app in the first place? Is there a merit to keep it separated?

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 4, 2019

@mteodori @salaboy

change the front-end to skip the login screen as it would much less work than the above

I think that it is necessary to change the setting on the front-end side. In the current setting, Oauth 2 authentication using keycloak is set up.
https://github.com/Activiti/activiti-modeling-app/blob/master/src/app.config.json

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 6, 2019

@salaboy @mteodori
I started PR with a plan to realize with spring boot world. Authentication etc are not yet available.
Activiti/activiti-cloud-modeling#38

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 7, 2019

@mteodori we need spring security there.. I don't want to change the app behaviour because of the way that we choose to deploy it. This is quite common even for standalone applications. We want to make sure that we can pick up the currently logged in user, the entire application relies on such data. Also we don't want to maintain to separate applications.

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 7, 2019

@daisuke-yoshimoto yes.. we need to basically exclude keycloak apdater and just configure spring security to use OAuth2 with a set of users defined maybe in a property file (??) we need to investigate this. Using OAuth2 will allow us to not change the front end at all.

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 7, 2019

@daisuke-yoshimoto we cannot merge both projects in a single repository.. because backend and front end have separate lifecycles.. what I suggested above is to have a third repository where we do the integration using a script.

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 7, 2019

@salaboy

we cannot merge both projects in a single repository.. because backend and front end have separate lifecycles.. what I suggested above is to have a third repository where we do the integration using a script.

Ok. As the following pr, how about submodule approach?
Activiti/activiti-cloud-modeling#38

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 7, 2019

@daisuke-yoshimoto as submodule yes.. that looks better.. because it is just a link between two repos.

@mteodori

This comment has been minimized.

Copy link
Member

mteodori commented Jan 7, 2019

I am checking with @popovicsandras if we can have an option to skip login otherwise at the moment we need an oauth2 implementation in the backend, for the other approach I am a bit lost for me the third repository would have been similar to the one I created with no changes on the other ones

@daisuke-yoshimoto

This comment has been minimized.

Copy link
Member

daisuke-yoshimoto commented Jan 8, 2019

@salaboy
Hi. Let me check a little about process modeler issue. #2324

When this issue is completed, will we basically use modeler's frontend and backend as one container? Do we leave use cases treated as separate containers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment