Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Enhance get_service_object & run_container_with_retries #130

Merged

Conversation

sekulicd
Copy link
Contributor

This PR enhances run_container_with_retries by introducing dynamic Docker labeling within the predmd application to support proxy configurations.
This PR enhances the get_service_object function to dynamically construct URLs based on the availability of a DNS domain.

This closes #128
This closes #129

@filopedraz please review.

Copy link
Contributor

@filopedraz filopedraz left a comment

Choose a reason for hiding this comment

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

Great job @sekulicd, just a couple of details.

@@ -77,6 +78,15 @@ def get_service_object(
else:
service["downloaded"] = False

proxy_enabled = os.environ.get("PROXY_ENABLED", "false").lower() == "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put proxy_enabled env variable loading with the rest of the configs: https://github.com/premAI-io/prem-daemon/blob/main/app/core/config.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of strings I would use boolean.

PROXY_ENABLED = os.getenv("PROXY_ENABLED", False)

and use it in services:

if config.PROXY_ENABLED:
    do_stuff()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the changes. Did you push the code? @sekulicd

app/core/utils.py Outdated Show resolved Hide resolved
@filopedraz
Copy link
Contributor

@sekulicd also please add the new env variable in .env.example :)

@sekulicd
Copy link
Contributor Author

sekulicd commented Sep 1, 2023

@sekulicd also please add the new env variable in .env.example :)

what is the logic here, do we put all env vars that occurs in code base? asking this since PROXY_ENABLED is only relevant for deployment with prem-gateway. @filopedraz

@filopedraz
Copy link
Contributor

Yes, all the env variables should be there as a reference. By default, it will be False in config.py.

@sekulicd
Copy link
Contributor Author

sekulicd commented Sep 1, 2023

Yes, all the env variables should be there as a reference. By default, it will be False in config.py.

Done

@filopedraz filopedraz merged commit b115311 into premAI-io:main Sep 1, 2023
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants