Skip to content

Allow the usage of mirror registries/repositories in all/most places#984

Open
mozesl-nokia wants to merge 4 commits into
kptdev:mainfrom
nokia:mirror-mirror
Open

Allow the usage of mirror registries/repositories in all/most places#984
mozesl-nokia wants to merge 4 commits into
kptdev:mainfrom
nokia:mirror-mirror

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Collaborator

Title

Allow the usage of mirror registries/repositories in all/most places


Description

  • What changed: You can now pass even more environment variables to replace default registries/repositories:
    • Dockerfiles
    • Make targets
    • Bash scripts
    • DB unit test suite
  • Why it’s needed: So that you can work more easily behind (increasingly stricter) proxies
  • How it works: Define env vars before commands or use a .env file for convenience

Related Issue(s)

(I thought we opened (and fixed) an issue for this, but I cannot find it.)


Type of Change

  • Other: Development environment

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

Testing Instructions (Optional)

  1. make setup-dev-env
  2. make run-in-kind-db-cache
  3. Tried a few other make targets, like reload-server and reload-function-runner, but please try your favourite make targets and scripts too to make sure they all work.

Additional Notes (Optional)

  • Further improvements: Somehow add the GHCR mirror to the prefix list of the FunctionConfigs in the example deployment.
  • Review notes: Added a few comments like: "TODO: do we still use this?", I am pretty sure these are unused and should be removed. Please check. Also, I am open to changing the names of the env vars.

AI Disclosure

I have not used AI in the creation of this PR.

Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds environment-variable-driven registry/mirror overrides for development builds, deployment scripts, kpt functions, and DB tests so contributors can work behind registry/proxy restrictions.

Changes:

  • Adds .env/environment support for GHCR, Docker Hub, and Maven mirror configuration.
  • Replaces hardcoded kpt function and Docker base image registries with configurable prefixes.
  • Extends DB tests and dev setup scripts to consume mirror-related environment variables.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
.env.template Documents mirror-related environment variables.
Makefile Exports registry mirror defaults and adds dump-env.
build/Dockerfile Makes Docker Hub base images configurable.
build/Dockerfile.apiserver Adds usage TODO comment.
build/Dockerfile.etcd Adds usage TODO comment.
build/Makefile Passes Docker Hub mirror build args.
controllers/Dockerfile Makes builder base image configurable.
controllers/Makefile Passes Docker Hub mirror build args.
func/Dockerfile Makes kpt function and base image registries configurable.
func/Dockerfile-wrapperserver Makes base images configurable.
func/Makefile Passes mirror-related build args.
go.mod Adds godotenv dependency.
go.sum Adds checksums for godotenv.
make/deploy.mk Adjusts setup-dev-env help placement.
pkg/cache/dbcache/dbcache_test.go Loads .env and applies Maven mirror to embedded Postgres.
scripts/common.sh Loads .env and centralizes mirror defaults.
scripts/create-deployment-blueprint.sh Uses configurable kpt function images and env-based Docker Hub mirror.
scripts/create-deployment-config.sh Passes GHCR prefix to deployment blueprint generation.
scripts/create-deployment-kpt.sh Uses configurable kpt function images.
scripts/install-dev-gitea-setup.sh Sources common config and applies mirrors to Gitea setup.
scripts/remove-controller-from-deployment-config.sh Uses configurable kpt function image prefix.
scripts/remove-porch-server-from-deployment-config.sh Uses configurable kpt function image prefix.
scripts/run-load-test.sh Uses configurable kpt function image prefix.
test/Dockerfile Adds usage TODO comment.
test/Makefile Adds usage TODO comment.
Comments suppressed due to low confidence (1)

scripts/create-deployment-kpt.sh:136

  • This is another PORCH_GHCR_PREFIX_URL use in a set -u script that never initializes the variable. A direct run without the env var fails here before deployment customization can proceed.
    --image "${PORCH_GHCR_PREFIX_URL}/starlark:v0.5.5" \

Comment thread Makefile Outdated
Comment thread scripts/remove-porch-server-from-deployment-config.sh
Comment thread scripts/remove-controller-from-deployment-config.sh
Comment thread scripts/run-load-test.sh
Comment thread scripts/create-deployment-blueprint.sh
Comment thread test/Makefile
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: do we still use this?
Comment thread test/Dockerfile
# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: do we still use this?
Comment thread build/Dockerfile.etcd
Comment on lines +15 to +16
# TODO: do we still use this?

# See the License for the specific language governing permissions and
# limitations under the License.

# TODO: do we still use this?
Comment thread scripts/create-deployment-kpt.sh
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants