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

Log during startup about environment register status #4968

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

maaktweluit
Copy link
Contributor

Also moved it to a loop since the code was getting repetative

Copy link
Contributor

@etam etam left a comment

Choose a reason for hiding this comment

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

ok

if NonHypervisedDockerGPUEnvironment.supported().supported:
_register_docker_gpu_env(work_dir, env_manager)
for (env_id, env_cls, _register) in ENVS:
if env_id in TASK_API_ENVS:
Copy link
Contributor

Choose a reason for hiding this comment

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

how about this?

if env_id not in TASK_API_ENVS:
    logger.debug('Environment disabled. env_id=%r', env_id)
    continue
if not env_cls.supported().supported:
    logger.info('Environment not supported. env_id=%r', env_id)
    continue
logger.info('Registering environment. env_id=%r', env_id)
_register(work_dir, env_manager)

makes it a bit more flat and puts error handling near condition checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice one! fixed it :)

@codecov
Copy link

codecov bot commented Dec 18, 2019

Codecov Report

Merging #4968 into develop will decrease coverage by <.01%.
The diff coverage is 83.33%.

@@             Coverage Diff             @@
##           develop    #4968      +/-   ##
===========================================
- Coverage    89.91%   89.91%   -0.01%     
===========================================
  Files          238      238              
  Lines        22407    22413       +6     
===========================================
+ Hits         20147    20152       +5     
- Misses        2260     2261       +1

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2020

CLA assistant check
All committers have signed the CLA.

@maaktweluit maaktweluit merged commit eedb0c0 into develop Mar 20, 2020
@maaktweluit maaktweluit deleted the mwu/task-api-env-status-log branch March 20, 2020 18:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants