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

fix: prioritize environment variables for image_name and executor_ima… #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions gateway_provisioners/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import urllib3 # docker ends up using this and it causes lots of noise, so turn off warnings
from jupyter_client import localinterfaces
from overrides import overrides
from traitlets import Unicode, default
from traitlets import Unicode

from .remote_provisioner import RemoteProvisionerBase

Expand Down Expand Up @@ -43,10 +43,6 @@ class ContainerProvisionerBase(RemoteProvisionerBase):
(GP_IMAGE_NAME env var)""",
)

@default("image_name")
def _image_name_default(self):
return os.getenv(self.image_name_env)

executor_image_name_env = "GP_EXECUTOR_IMAGE_NAME"
executor_image_name = Unicode(
None,
Expand All @@ -56,13 +52,13 @@ def _image_name_default(self):
container-based kernels within Spark environments. (GP_EXECUTOR_IMAGE_NAME env var)""",
)

@default("executor_image_name")
def _executor_image_name_default(self):
return os.getenv(self.executor_image_name_env) or self.image_name

def __init__(self, **kwargs):
super().__init__(**kwargs)

self.image_name = os.getenv(self.image_name_env) or self.image_name
self.executor_image_name = (
os.getenv(self.executor_image_name_env) or self.executor_image_name or self.image_name
)
self.container_name = None
self.assigned_node_ip = None

Expand Down
Loading