|
55 | 55 | + os.environ.get("CONTAINER_ENGINE_EXECUTABLE", "docker").upper() |
56 | 56 | + "with GPU capabilites : " |
57 | 57 | + os.environ.get("GPU_DEVICE", "nvidia.com/gpu=all") |
| 58 | + + " network_disabled for the competition container is set to " |
| 59 | + + os.environ.get("COMPETITION_CONTAINER_NETWORK_DISABLED", "False") |
58 | 60 | ) |
59 | 61 | else: |
60 | 62 | logger.info( |
61 | 63 | "Using " |
62 | 64 | + os.environ.get("CONTAINER_ENGINE_EXECUTABLE", "docker").upper() |
63 | | - + " without GPU capabilities" |
| 65 | + + " without GPU capabilities. " |
| 66 | + + "network_disabled for the competition container is set to " |
| 67 | + + os.environ.get("COMPETITION_CONTAINER_NETWORK_DISABLED", "False") |
64 | 68 | ) |
65 | 69 |
|
66 | 70 | if os.environ.get("CONTAINER_ENGINE_EXECUTABLE", "docker").lower() == "docker": |
@@ -982,8 +986,8 @@ async def _run_program_directory(self, program_dir, kind): |
982 | 986 | ) |
983 | 987 | # Disable or not the competition container access to Internet (False by default) |
984 | 988 | container_network_status = os.environ.get( |
985 | | - "COMPETITION_CONTAINER_NETWORK_DISABLED", "False" |
986 | | - ).title() |
| 989 | + "COMPETITION_CONTAINER_NETWORK_DISABLED", "" |
| 990 | + ) |
987 | 991 |
|
988 | 992 | # HTTP and HTTPS proxy for the competition container if needed |
989 | 993 | competition_container_proxy_http = os.environ.get( |
@@ -1012,7 +1016,7 @@ async def _run_program_directory(self, program_dir, kind): |
1012 | 1016 | competition_container_proxy_http, |
1013 | 1017 | competition_container_proxy_https, |
1014 | 1018 | ], |
1015 | | - network_disabled=container_network_status, |
| 1019 | + network_disabled=container_network_status.lower() in ["true"], |
1016 | 1020 | ) |
1017 | 1021 | logger.debug("Created container : " + str(container)) |
1018 | 1022 | logger.info("Volume configuration of the container: ") |
|
0 commit comments