Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing passing port as a build argument to containers #259

Closed
wants to merge 1 commit into from

Conversation

Gregory-Pereira
Copy link
Collaborator

Re-opening #258 on upstream branch because tests weren't working from my fork. Guessing this is some funkyness resulting from toggling actions off then back on in my fork.

I discovered when playing around with builds that the way we were passing PORT arguments wasnt working, because we both were exposing a static port number in the Containerfile and because we were passing the actual argument for it incorrectly:

# Tested from the `object_detection_python` model_server but all builds were the same
$ make PORT=20203 build
podman build --squash-all \
	  --build-arg PORT=20203 \
	  -t quay.io/ai-lab/model_servers/object_detection_python:latest . -f base/Containerfile
...
STEP 6/7: EXPOSE 8000
...
Successfully tagged quay.io/ai-lab/model_servers/object_detection_python:latest
bd834bd87c2605cf5e0cc93ee3e4c23c9b7fb030040cea6eb56b0e401efd4e27

Then verified inspecting the image:

podman inspect bd834bd87c2605cf5e0cc93ee3e4c23c9b7fb030040cea6eb56b0e401efd4e27
...
"ExposedPorts": {
    "8000/tcp": {},
    "8080/tcp": {}
},

The new builds produce the following:

$ make PORT=20203 build
...
STEP 2/8: ARG PORT
...
STEP 7/8: EXPOSE $PORT
...
Successfully tagged quay.io/ai-lab/model_servers/object_detection_python:latest
bd834bd87c2605cf5e0cc93ee3e4c23c9b7fb030040cea6eb56b0e401efd4e27
$ podman inspect bd834bd87c2605cf5e0cc93ee3e4c23c9b7fb030040cea6eb56b0e401efd4e27
...
"ExposedPorts": {
    "20203/tcp": {},
    "8080/tcp": {}
},

Signed-off-by: greg pereira <[email protected]>

hoping to trigger tests

Signed-off-by: greg pereira <[email protected]>
@Gregory-Pereira
Copy link
Collaborator Author

This one is no better, tests not running. I will close this.

@Gregory-Pereira Gregory-Pereira deleted the pass-ports-to-container-builds branch April 13, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant