This project is for the course projets informatics (pinfo) given in third year bachelor of computer science at University of Geneva. This project was imported from the project that was originally in Fabrice Hategekimana's github.
Members:
- Project manager: Mohsen Hassan Naeini
- Backend: Ethan Icet
- Backend: Stéphane Liem Nguyen (is also crystalzenchi)
- Auth & Kubernetes: Erwan Don
- Frontend: Raphaël Maggio-Aprile
- Kubernetes: Fabrice Hategekimana
We created a website in which we could join groups and vote for movies. Even though the recommendation or voting part was handcrafted and very basic, the goal of this project was to discover principles.
- Original project's wiki
- Project's template forked from https://github.com/hostettler/microservices
Make the file executable then run the script (but make sure no Docker containers having same names are currently running otherwise use the kill_remove_containers.sh
script before running run_locally.sh
):
$ chmod u+x scripts/run_locally.sh
$ ./scripts/run_locally.sh
Make the file executable then run the script:
$ chmod u+x scripts/kill_remove_containers.sh
$ ./scripts/kill_remove_containers.sh
All commands should be in super-user.
In the current directory:
$ mvn clean install
Output should look like:
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Moviet Microservices 0.1.0-SNAPSHOT:
[INFO]
[INFO] Moviet Microservices ............................... SUCCESS [ 0.447 s]
[INFO] Group Service ...................................... SUCCESS [ 4.943 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.548 s
[INFO] Finished at: 2021-03-28T11:18:11+02:00
[INFO] ------------------------------------------------------------------------
We have to make sure first that the docker daemon is running (with ps -a
and check if dockerd
is running, otherwise do sudo dockerd
)
$ mvn install -Ppackage-docker-image
Output should look like:
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Moviet Microservices 0.1.0-SNAPSHOT:
[INFO]
[INFO] Moviet Microservices ............................... SUCCESS [ 1.148 s]
[INFO] Group Service ...................................... SUCCESS [ 9.105 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.405 s
[INFO] Finished at: 2021-03-28T11:30:27+02:00
[INFO] ------------------------------------------------------------------------
Remark(s):
- (copied from Maven Introduction) When you define profiles in a POM, you can also pass them as argument to Maven with the -P option. In the microservices example, the command mvn install -Ppackage-docker-image runs the install lifecycle of Maven on the package-docker-image profile.
And to make sure the Docker images have been created:
$ docker image ls | grep unige
Output should look like:
unige/group-service latest e66e2588a92f 3 minutes ago 706MB
For the group-service
, we can do this:
$ docker run -p 10080:8080 --name=group-service unige/group-service &
The &
specifies that we want the process to be in background. We should see Thorntail is Ready
.
We can check that it works by going to localhost:10080/groups
to see all the groups and http://localhost:10080/groups/{id}
with {id}
being the id of an existant group in the list of groups, for instance 42
: http://localhost:10080/groups/42
(Currently, the "no group corresponding to the id" is not handled).