How to compile and install from scratch

Hi everyone,
how to compile and build projects step by step, do you have any instructions?
as almost projects for example:
git clone…
mvn compile
mvn install
I think its better a
I used the docker-compose command, when my server crashed, my one-week data entry completely wiped out.
with this error message: your container is unhealthy
thanks

Hi,

Compiling the project is explained in the wiki as is building the docker images. Our build tool is gradle:

./gradlew clean installDist

Then you need to build the manager docker image which is explained in the wiki.

Not really sure what building has to do with the second part of your post about losing data but to try and help:

The default docker-compose.yml in the repo didn’t have a named volume defined for the postgresql data but instead used an anonymous volume. I have now added a named volume called postgresql-data. But even with an anonymous volume data should be persisted between restarts, unless some sort of corruption has occurred or you upgraded the manager container and the DB was no longer compatible with this build.

Hi @Rich
thank you for your reply
I want to have all components in the local machine. when I change something in code, I want to be able to run new code and see results in IDE or command line, or web browser(if it’s a web app). an environment for development with Postgres, and project-related codes.
now, I don’t know what is the proxy project? is mandatory for setting up the whole project.
I will be appreciated if you more explain how to set up the whole project for development
thanks again

one question @Rich : all of openremote data is in Postgresql?
when I down all docker and up again all data is there?

Yes all persistent data is stored in the postgresql DB (including Keycloak user data). The postgresql DB can be stored in a named volume and easily preserved between docker-compose up/down with the caveat that there could be breaking schema changes.

In the next few months we will move to formal releases and automatic DB migration scripts will be provided to deal with such breaking changes.

As for working in an IDE, this is all covered in the wiki. If you want to work on the manager backend then you generally want the profile/dev-testing.yml docker compose profile running which provides keycloak and postgres, then you just open the repo in an IDE like IntelliJ IDEA and it can import the gradle build data for you and you can then run within the IDE.

For frontend work we use npm, webpack and typescript so for example to work on the Manager UI:

  • cd ui/app/manager
  • npm run modelBuild → Will build the typescript model from our java model
  • npm run watch → Will compile typescript into javascript and monitor file changes
  • npm run serve → Will serve the app and provide live reload on http://localhost:9000/manager

The proxy project is the reverse proxy that sits in front of the other services and provides SSL/TLS termination in a production environment and generally isn’t used in development unless specifically testing this functionality.

thank you @Rich for your patient and complete reply.
I start to set up the project in IDE by using wiki instruction and if I encounter problem ask you here
thanks again

thanks again @Rich, i did it and it works

Hello, again @Rich,
your recommendation worked for me and I changed little(map, and …).
now I want again to build the manager and push in the docker hub.
I did but I faced the error “manager container service_health” when the proxy is coming up.
how to build a manager docker from a changed source?

I solved the problem by try and error method.
I built Openremote (and separately built Openremote/manager, I don’t know this step was necessary)
then I built “manager docker” based on Dockerfile in openremote/manager/build/install/manager instead of using root Dockerfile

1 Like