dockerizing_4dscience/README.md

177 lines
6.2 KiB
Markdown
Raw Normal View History

2024-10-30 12:15:37 +01:00
# gCube System - Dockerized D4Science
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
## Version
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
version `v1.0.0`
## Structure of the project
This project provides a containerized environment for two primary services: `socialservice` and `liferay`, each supported by its specific infrastructure. The configuration allows the two infrastructures to be launched independently or together, and services can be started individually if desired.
## Built With
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
Docker
## Documentation
### GIT
the first time you check-out a repo you need to use --init
2024-10-15 16:47:41 +02:00
`git submodule update --init --recursive`
the other times
`git pull --recurse-submodules`
2024-10-30 12:15:37 +01:00
### Services
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
* **socialservice**: Located in `socialservice/`, this includes configurations and Docker setups for deploying a custom social networking service. It depends on Cassandra and Keycloak to handle database storage and identity management, respectively.
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
* [cassandra](./cassandra/README.md)
* [socialservice](./socialservice/README.md)
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
docker commands:
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
`docker compose up cassandra1 cassandra2 cassandra3 socialservice --build --force-recreate -d`
`docker compose stop cassandra1 cassandra2 cassandra3 socialservice`
* **liferay**: The `liferay/` directory contains all configurations and Dockerfiles required to deploy the Liferay content management platform, along with its supporting infrastructure like PostgreSQL.
* [postgres](./postgres/README.md)
* [keycloak](./keycloak/README.md)
* [liferay](./liferay/README.md)
docker commands:
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
`docker compose up postgres keycloak liferay --build --force-recreate -d`
`docker compose stop postgres keycloak liferay`
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
### Docker compose instructions
2024-08-05 12:43:45 +02:00
you can start the 2 services individually entering in the folder and starting the docker compose instance, or start the common compose in the base folder.
start common composer:
2024-10-30 12:15:37 +01:00
`docker compose up -d`
2024-08-05 12:43:45 +02:00
2024-10-30 12:15:37 +01:00
force recreate docker image:
2024-08-05 12:43:45 +02:00
`docker compose build --no-cache`
2024-10-30 12:15:37 +01:00
you can force the build and/or reload:
`docker compose up --build --force-reloads -d`
check status:
* postgres: `docker inspect --format='{{json .State.Health}}' lr_docker-postgres-1`
* keycloak: `docker inspect --format='{{json .State.Health}}' lr_docker-keycloak-1`
* liferay: `docker inspect --format='{{json .State.Health}}' lr_docker-liferay-1`
* socialservice: `docker inspect --format='{{json .State.Health}}' lr_docker-socialservice`
* cassandara1: `docker inspect --format='{{json .State.Health}}' cassandra1`
* cassandara2: `docker inspect --format='{{json .State.Health}}' cassandra2`
* cassandara3: `docker inspect --format='{{json .State.Health}}' cassandra3`
open bash in instance:
* postgres: `docker exec -it lr_docker-postgres-1 /bin/sh`
* keycloak: `docker exec -it lr_docker-keycloak-1 /bin/sh`
* liferay: `docker exec -it lr_docker-liferay-1 /bin/sh`
* socialservice: `docker exec -it lr_docker socialservice /bin/sh`
* cassandra1: `docker exec -it lr_docker cassandra1 /bin/sh`
* cassandra2: `docker exec -it lr_docker cassandra2 /bin/sh`
* cassandra3: `docker exec -it lr_docker cassandra3 /bin/sh`
#### All services
`docker compose up --build *d`
`docker compose stop`
#### Social Service
`docker compose up cassandra1 cassandra2 cassandra3 socialservice --build *d`
`docker compose stop cassandra1 cassandra2 cassandra3 socialservice`
### Liferay service
`docker compose up postgres keycloak liferay --build *d`
`docker compose stop postgres keycloak liferay`
### Single components
#### cassandra
[cassandra](./cassandra/README.md) is the dockerization of the cassandra infrastructure
it contains the script for dumping the devel environment, and the [Dockerfile](./cassandra/Dockerfile) and [Docker compose](./cassandra/compose.yaml) files to build and start the composed instance with the dumped schema and data
`docker compose up cassandra1 cassandra2 cassandra3 --build *d`
`docker compose stop cassandra1 cassandra2 cassandra3`
2024-08-05 12:43:45 +02:00
check status:
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
* cassandara1
* `docker inspect --format='{{json .State.Health}}' cassandra1`
* `docker exec -it cassandra1 nodetool status`
* cassandara2
* `docker inspect --format='{{json .State.Health}}' cassandra2`
* `docker exec -it cassandra1 nodetool status`
* cassandara3
* `docker inspect --format='{{json .State.Health}}' cassandra3`
* `docker exec -it cassandra1 nodetool status`
#### socialservice
[socialservice](./socialservice/README.md) is the dockerization of the socialservice infrastructure
it contains the script for dumping the devel environment, and the [Dockerfile](./socialservice/Dockerfile) and [Docker compose](./socialservice/compose.yaml) files to build and start the composed instance with the dumped schema and data
#### Keycloak
[keycloack](./keycloack/README.md) is the dockerization of the keycloack authentication services. it contains the [Dockerfile](./socialservice/Dockerfile) and [Docker compose](./socialservice/compose.yaml) files to build and start the composed instance with the d4science.json data
### Liferay
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
to exec the liferay instance you need to to your host file (`/etc/host`) the entries:
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
```txt
2024-10-15 16:47:41 +02:00
127.0.0.1 keycloak
127.0.0.1 liferay
2024-10-30 12:15:37 +01:00
```
2024-10-15 16:47:41 +02:00
keycloak server: http://keycloak:9999
liferay server:
* http://liferay:80
* http://next.dev.d4science.org:80
2024-10-30 12:15:37 +01:00
open bash on server
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
check db connection:
`docker exec -it lr_docker-liferay-1 bash -c 'PGPASSWORD=pass_db psql -h lr_docker-postgres-1 -U infra_bundle_dev -d liferay_db'`
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
## Change log
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
See [Releases](https://code-repo.d4science.org/gCubeSystem/${project.artifactId}/releases).
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
## Authors
2024-10-15 16:47:41 +02:00
2024-10-30 12:15:37 +01:00
* **Alfredo Oliviero** ([ORCID]( https://orcid.org/0009-0007-3191-1025)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/A.Oliviero)
## Maintainers
* **Alfredo Oliviero** ([ORCID]( https://orcid.org/0009-0007-3191-1025)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/A.Oliviero)
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
## About the gCube Framework
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)