MCPcopy
hub / github.com/zenml-io/zenml / get_environment

Function get_environment

src/zenml/environment.py:65–105  ·  view source on GitHub ↗

Returns a string representing the execution environment of the pipeline. Returns: str: the execution environment

()

Source from the content-addressed store, hash-verified

63
64
65def get_environment() -> str:
66 """Returns a string representing the execution environment of the pipeline.
67
68 Returns:
69 str: the execution environment
70 """
71 # Order is important here
72 if Environment.in_kubernetes():
73 return EnvironmentType.KUBERNETES
74 elif Environment.in_github_actions():
75 return EnvironmentType.GITHUB_ACTION
76 elif Environment.in_gitlab_ci():
77 return EnvironmentType.GITLAB_CI
78 elif Environment.in_circle_ci():
79 return EnvironmentType.CIRCLE_CI
80 elif Environment.in_bitbucket_ci():
81 return EnvironmentType.BITBUCKET_CI
82 elif Environment.in_ci():
83 return EnvironmentType.GENERIC_CI
84 elif Environment.in_github_codespaces():
85 return EnvironmentType.GITHUB_CODESPACES
86 elif Environment.in_zenml_codespace():
87 return EnvironmentType.ZENML_CODESPACE
88 elif Environment.in_vscode_remote_container():
89 return EnvironmentType.VSCODE_REMOTE_CONTAINER
90 elif Environment.in_lightning_ai_studio():
91 return EnvironmentType.LIGHTNING_AI_STUDIO
92 elif Environment.in_docker():
93 return EnvironmentType.DOCKER
94 elif Environment.in_container():
95 return EnvironmentType.CONTAINER
96 elif Environment.in_google_colab():
97 return EnvironmentType.COLAB
98 elif Environment.in_paperspace_gradient():
99 return EnvironmentType.PAPERSPACE
100 elif Environment.in_notebook():
101 return EnvironmentType.NOTEBOOK
102 elif Environment.in_wsl():
103 return EnvironmentType.WSL
104 else:
105 return EnvironmentType.NATIVE
106
107
108class Environment(metaclass=SingletonMetaClass):

Callers 5

show_dashboard_with_urlFunction · 0.90
infoFunction · 0.90
trackMethod · 0.90
get_run_environment_dictFunction · 0.85

Calls 15

in_kubernetesMethod · 0.80
in_github_actionsMethod · 0.80
in_gitlab_ciMethod · 0.80
in_circle_ciMethod · 0.80
in_bitbucket_ciMethod · 0.80
in_ciMethod · 0.80
in_github_codespacesMethod · 0.80
in_zenml_codespaceMethod · 0.80
in_dockerMethod · 0.80
in_containerMethod · 0.80

Tested by 1