diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index f51cc63..e479558 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,13 +1,13 @@ arguments= auto.sync=false build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.0.2)) +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= java.home= jvm.arguments= offline.mode=false -override.workspace.settings=true -show.console.view=true -show.executions.view=true +override.workspace.settings=false +show.console.view=false +show.executions.view=false diff --git a/docker-compose/.env b/docker-compose/.env index 482edf8..5c6dc11 100644 --- a/docker-compose/.env +++ b/docker-compose/.env @@ -6,30 +6,33 @@ COMPOSE_PROJECT_NAME="adempiere-processor" POSTGRES_IMAGE="postgres:13" POSTGRES_NAME="adempiere-processor.postgres.database" POSTGRES_PASSWORD="adempiere" -POSTGRES_PORT="5432" +POSTGRES_PORT="55432" POSTGRES_VOLUME="adempiere-processor.volume_postgres" # ADempiere gRPC Server -ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.4" -ADEMPIERE_PROCESSOR_HOST="adempiere-processor.processor" +ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.6" +ADEMPIERE_PROCESSOR_HOST="${COMPOSE_PROJECT_NAME}.adempiere-processor" # Networks ADEMPIERE_NETWORK="adempiere-processor.adempiere_network" # Envoy Definition -ENVOY_NAME="adempiere-processor.grpc.proxy" +ENVOY_NAME="${COMPOSE_PROJECT_NAME}.grpc.proxy" ENVOY_IMAGE_NAME="envoyproxy/envoy:v1.27.0" ENVOY_VOLUME="volume_envoy" ENVOY_PORT=5555 DKRON_IMAGE="dkron/dkron" -DKRON_HOST="adempiere-processor.dkron" +DKRON_HOST="${COMPOSE_PROJECT_NAME}.dkron" DKRON_PORT=8080 DKRON_VOLUME="adempiere-processor.volume_dkron" -RUNDECK_IMAGE="rundeck/rundeck:4.12.0" -RUNDECK_HOST="adempiere-processor.rundeck" -RUNDECK_PORT=4440 -RUNDECK_REALM_SETTING="./rundeck/realm.properties" -RUNDECK_USER_POLICIES="./rundeck/user.aclpolicy" +# Adempiere UI ZK +ADEMPIERE_ZK_IMAGE="openls/adempiere-zk-ui:jetty-1.2.0" +ADEMPIERE_ZK_HOST="${COMPOSE_PROJECT_NAME}.adempiere.zk" +ADEMPIERE_ZK_PORT=8081 +ADEMPIERE_ZK_DB_HOST=${POSTGRES_NAME} +ADEMPIERE_ZK_DB_PORT=5432 +ADEMPIERE_ZK_DB_NAME="adempiere" +ADEMPIERE_ZK_DB_PASSWORD=${POSTGRES_PASSWORD} diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 8b676c1..f38aefe 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -2,16 +2,15 @@ version: "3.9" services: adempiere.db: - build: - context: postgresql/ - dockerfile: Dockerfile container_name: ${POSTGRES_NAME} - image: ${POSTGRES_NAME} + image: ${POSTGRES_IMAGE} restart: ${GENERIC_RESTART} ports: - - ${POSTGRES_PORT} + - ${POSTGRES_PORT}:5432 volumes: - volume_postgres:/var/lib/postgresql/data + - ./postgresql/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh + - ./postgresql/adempiere:/tmp/adempiere healthcheck: test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/5432; exit $?;'" interval: 10s @@ -52,23 +51,27 @@ services: - "--bootstrap-expect=1" - "--node-name=node1" - "--server" - - "--ui=false" +# - "--ui=false" volumes: - volume_dkron:/dkron.data networks: - shared_network - - rundeck.scheduler: - container_name: ${RUNDECK_HOST} - image: ${RUNDECK_IMAGE} + + adempiere.zk: + image: ${ADEMPIERE_ZK_IMAGE} + container_name: ${ADEMPIERE_ZK_HOST} restart: ${GENERIC_RESTART} ports: - - ${RUNDECK_PORT}:4440 - volumes: - - ${RUNDECK_REALM_SETTING}:/home/rundeck/server/config/realm.properties - - ${RUNDECK_USER_POLICIES}:/home/rundeck/etc/user.aclpolicy + - ${ADEMPIERE_ZK_PORT}:8080 + environment: + ADEMPIERE_DB_SERVER: ${ADEMPIERE_ZK_DB_HOST} + ADEMPIERE_DB_NAME: ${ADEMPIERE_ZK_DB_NAME} + ADEMPIERE_DB_PASSWORD: ${ADEMPIERE_ZK_DB_PASSWORD} + depends_on: + adempiere.db: + condition: service_healthy networks: - - shared_network + - shared_network grpc.proxy: image: ${ENVOY_IMAGE_NAME} diff --git a/docker-compose/postgresql/Dockerfile b/docker-compose/postgresql/Dockerfile deleted file mode 100644 index 5d71bd9..0000000 --- a/docker-compose/postgresql/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM postgres:13 - -ADD https://github.com/adempiere/adempiere-processors-service/releases/download/1.0.2/adempiere_postgresql_seed.tar.gz /tmp/adempiere_postgresql_seed.tar.gz - -COPY --chown=1 initdb.sh /docker-entrypoint-initdb.d -RUN chmod +x /docker-entrypoint-initdb.d/initdb.sh && \ - tar -xvf /tmp/adempiere_postgresql_seed.tar.gz && \ - rm /tmp/adempiere_postgresql_seed.tar.gz diff --git a/docker-compose/postgresql/adempiere/after_run/001_tunning.sql b/docker-compose/postgresql/adempiere/after_run/001_tunning.sql new file mode 100644 index 0000000..4c6d765 --- /dev/null +++ b/docker-compose/postgresql/adempiere/after_run/001_tunning.sql @@ -0,0 +1,26 @@ +ALTER SYSTEM SET + max_connections = '500'; +ALTER SYSTEM SET + shared_buffers = '1GB'; +ALTER SYSTEM SET + effective_cache_size = '3GB'; +ALTER SYSTEM SET + maintenance_work_mem = '256MB'; +ALTER SYSTEM SET + checkpoint_completion_target = '0.9'; +ALTER SYSTEM SET + wal_buffers = '16MB'; +ALTER SYSTEM SET + default_statistics_target = '100'; +ALTER SYSTEM SET + random_page_cost = '1.1'; +ALTER SYSTEM SET + effective_io_concurrency = '200'; +ALTER SYSTEM SET + work_mem = '524kB'; +ALTER SYSTEM SET + huge_pages = 'off'; +ALTER SYSTEM SET + min_wal_size = '1GB'; +ALTER SYSTEM SET + max_wal_size = '4GB'; \ No newline at end of file diff --git a/docker-compose/postgresql/adempiere/after_run/002_update_model_validator.sql b/docker-compose/postgresql/adempiere/after_run/002_update_model_validator.sql new file mode 100644 index 0000000..c402e06 --- /dev/null +++ b/docker-compose/postgresql/adempiere/after_run/002_update_model_validator.sql @@ -0,0 +1,4 @@ +-- connects to the adempiere database and adempiere schema +\c adempiere adempiere + +UPDATE AD_System SET IsFailOnMissingModelValidator = 'N'; \ No newline at end of file diff --git a/docker-compose/postgresql/adempiere/seed.backup b/docker-compose/postgresql/adempiere/seed.backup new file mode 100644 index 0000000..c041a42 Binary files /dev/null and b/docker-compose/postgresql/adempiere/seed.backup differ diff --git a/docker-compose/postgresql/initdb.sh b/docker-compose/postgresql/initdb.sh index 4405979..5c4c944 100644 --- a/docker-compose/postgresql/initdb.sh +++ b/docker-compose/postgresql/initdb.sh @@ -5,5 +5,13 @@ then createuser -U postgres adempiere -dlrs psql -U postgres -tAc "alter user adempiere password 'adempiere';" createdb -U adempiere adempiere - psql -U adempiere -d adempiere < Adempiere_pg.dmp + pg_restore -U adempiere -d adempiere < /tmp/adempiere/seed.backup -v fi + +AFTER_RUN_DIR="/tmp/adempiere/after_run" +if [ -d "$AFTER_RUN_DIR" ]; then + find "$AFTER_RUN_DIR" -maxdepth 1 -type f -name '*.sql' -print0 | while IFS= read -r -d '' file; do + echo "importing $file" + psql -U adempiere < "$file" + done +fi \ No newline at end of file diff --git a/docker-compose/rundeck/user.aclpolicy b/docker-compose/rundeck/user.aclpolicy deleted file mode 100644 index 8d9d27c..0000000 --- a/docker-compose/rundeck/user.aclpolicy +++ /dev/null @@ -1,25 +0,0 @@ -description: Basic Access -context: - application: 'rundeck' -by: - group: 'user' -for: - project: - - equals: - name: 'sell-in-sell-out' - allow: [read] ---- -description: Project Access -context: - project: 'sell-in-sell-out' -by: - group: 'user' -for: - job: - - allow: [read,run,runAs,kill,killAs] # allow create/read/write/delete/run/kill of all jobs - node: - - allow: [read,run] - adhoc: - - allow: 'read' - resource: - - allow: 'read' \ No newline at end of file