diff --git a/.github/workflows/tang-actions.yaml b/.github/workflows/tang-actions.yaml index 953c710..d7cab6f 100644 --- a/.github/workflows/tang-actions.yaml +++ b/.github/workflows/tang-actions.yaml @@ -4,10 +4,10 @@ on: branches: - main paths-ignore: - - '**.md' + - "**.md" pull_request: paths-ignore: - - '**.md' + - "**.md" jobs: golangci: name: Lint @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: "1.23" + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: @@ -42,13 +42,17 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: "1.23" + go-version: "1.22" - name: start pulp - uses: isbang/compose-action@v2.0.1 + uses: isbang/compose-action@v2.0.2 with: compose-file: docker-compose.yml cwd: ./compose_files/pulp/ down-flags: --volumes + env: + PULP_DATABASE_PORT: 5434 + PULP_API_PORT: 8087 + PULP_CONTENT_PORT: 8088 - name: Wait for pulp run: | docker run --network=host --rm -v ${PWD}:/local curlimages/curl \ @@ -65,4 +69,4 @@ jobs: DATABASE_PASSWORD: password SERVER_URL: http://localhost:8087 SERVER_USERNAME: admin - SERVER_PASSWORD: password \ No newline at end of file + SERVER_PASSWORD: password diff --git a/compose_files/pulp/docker-compose.yml b/compose_files/pulp/docker-compose.yml index d0029ef..20a3a81 100644 --- a/compose_files/pulp/docker-compose.yml +++ b/compose_files/pulp/docker-compose.yml @@ -1,15 +1,14 @@ -version: '3' services: postgres: - image: "docker.io/library/postgres:13" + image: "docker.io/library/postgres:16" ports: - - "5434:5432" + - "${PULP_DATABASE_PORT:-5432}:5432" environment: POSTGRES_USER: pulp POSTGRES_PASSWORD: password POSTGRES_DB: pulp - POSTGRES_INITDB_ARGS: '--auth-host=scram-sha-256' - POSTGRES_HOST_AUTH_METHOD: 'scram-sha-256' + POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256" + POSTGRES_HOST_AUTH_METHOD: "scram-sha-256" volumes: - "pg_data:/var/lib/postgresql" - "./assets/postgres/passwd:/etc/passwd:Z" @@ -22,6 +21,7 @@ services: migration_service: image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + platform: linux/amd64 depends_on: postgres: condition: service_healthy @@ -30,10 +30,11 @@ services: volumes: - "./assets/settings.py:/etc/pulp/settings.py:z" - "./assets/certs:/etc/pulp/certs:z" - - "pulp:/var/lib/pulp" + - "pulp:/var/lib/pulp" set_init_password_service: - image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + platform: linux/amd64 command: set_init_password.sh depends_on: migration_service: @@ -51,16 +52,19 @@ services: - "redis_data:/data" restart: always healthcheck: - test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] + test: ["CMD", "redis-cli", "--raw", "incr", "ping"] pulp_api: image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + platform: linux/amd64 deploy: replicas: 1 - command: [ 'pulp-api' ] + command: ["pulp-api"] depends_on: migration_service: condition: service_completed_successfully + ports: + - ${PULP_API_PORT:-8080}:24817 hostname: pulp-api user: pulp volumes: @@ -73,16 +77,21 @@ services: PULP_ADMIN_PASSWORD: password PULP_DOMAIN_ENABLED: "true" PULP_API_ROOT: /api/pulp/ + PULP_CONTENT_ORIGIN: "http://pulp.content:8081/" + PULP_CONTENT_PATH_PREFIX: "/pulp/content/" restart: always pulp_content: image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + platform: linux/amd64 deploy: replicas: 1 - command: [ 'pulp-content' ] + command: ["pulp-content"] depends_on: migration_service: condition: service_completed_successfully + ports: + - ${PULP_CONTENT_PORT:-8081}:24816 hostname: pulp-content user: pulp volumes: @@ -94,28 +103,16 @@ services: POSTGRES_SERVICE_HOST: postgres PULP_DOMAIN_ENABLED: "true" PULP_API_ROOT: /api/pulp/ - restart: always - - pulp_web: - image: "pulp/pulp-web:latest" - command: [ '/usr/bin/nginx.sh' ] - depends_on: - migration_service: - condition: service_completed_successfully - ports: - - "8087:8080" - hostname: pulp - user: root - volumes: - - "./assets/bin/nginx.sh:/usr/bin/nginx.sh:Z" - - "./assets/nginx/nginx.conf.template:/etc/opt/rh/rh-nginx116/nginx/nginx.conf.template:Z" + PULP_CONTENT_ORIGIN: "http://pulp.content:8081/" + PULP_CONTENT_PATH_PREFIX: "/pulp/content/" restart: always pulp_worker: image: "quay.io/redhat-services-prod/pulp-services-tenant/pulp:latest" + platform: linux/amd64 deploy: - replicas: 1 - command: [ 'pulp-worker' ] + replicas: 2 + command: ["pulp-worker"] depends_on: migration_service: condition: service_completed_successfully @@ -130,6 +127,9 @@ services: POSTGRES_SERVICE_PORT: 5432 POSTGRES_SERVICE_HOST: postgres PULP_DOMAIN_ENABLED: "true" + PULP_API_ROOT: /api/pulp/ + PULP_CONTENT_ORIGIN: "http://pulp.content:8081/" + PULP_CONTENT_PATH_PREFIX: "/pulp/content/" restart: always volumes: pulp: diff --git a/go.mod b/go.mod index 67dc1de..f53ace3 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,23 @@ module github.com/content-services/tang -go 1.23 +go 1.22.0 + +toolchain go1.22.4 require ( - github.com/content-services/zest/release/v2024 v2024.9.1726768195 + github.com/content-services/zest/release/v2024 v2024.11.1731697894 github.com/google/uuid v1.6.0 github.com/jackc/pgx-zerolog v0.0.0-20230315001418-f978528409eb github.com/jackc/pgx/v5 v5.7.1 github.com/rs/zerolog v1.33.0 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 + golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f ) require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect @@ -37,10 +39,10 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index baf7694..a168a65 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/content-services/zest/release/v2024 v2024.3.1709674773 h1:kr7NX4UZhF9 github.com/content-services/zest/release/v2024 v2024.3.1709674773/go.mod h1:UnV5iAE/frEbOToKYweoIrRAQphmfv+2wN/fwr8ytcA= github.com/content-services/zest/release/v2024 v2024.9.1726768195 h1:4OjES3YJ6GVfyoI6CDBg/RBkUWofaw4go4bkYEkQ6cY= github.com/content-services/zest/release/v2024 v2024.9.1726768195/go.mod h1:UnV5iAE/frEbOToKYweoIrRAQphmfv+2wN/fwr8ytcA= +github.com/content-services/zest/release/v2024 v2024.11.1731697894 h1:DUQrNSNeeLRqdbfwZ7kW8w4hOvBWpRy3lW+YGUCd0zM= +github.com/content-services/zest/release/v2024 v2024.11.1731697894/go.mod h1:UnV5iAE/frEbOToKYweoIrRAQphmfv+2wN/fwr8ytcA= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -11,6 +13,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -111,14 +115,20 @@ golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -126,10 +136,14 @@ golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/mk/compose.mk b/mk/compose.mk index a9e7d94..f355f94 100644 --- a/mk/compose.mk +++ b/mk/compose.mk @@ -6,7 +6,7 @@ .PHONY: compose-up compose-up: ## Start up service dependencies using podman(docker)-compose - $(PULP_COMPOSE_COMMAND) + PULP_DATABASE_PORT=5434 PULP_API_PORT=8087 PULP_CONTENT_PORT=8088 $(PULP_COMPOSE_COMMAND) .PHONY: compose-down compose-down: ## Shut down service dependencies using podman(docker)-compose @@ -14,4 +14,4 @@ compose-down: ## Shut down service dependencies using podman(docker)-compose .PHONY: compose-clean ## Clear out data (dbs, files) for service dependencies compose-clean: compose-down - $(DOCKER) volume prune --force \ No newline at end of file + $(DOCKER) volume prune --force