Skip to content

Commit

Permalink
Disable action_generate_conda_docker on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Karetnikov committed Nov 21, 2023
1 parent 65fc72e commit bf69e05
Showing 1 changed file with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pathlib
import sys

from conda_store_server import action

Expand All @@ -13,35 +12,34 @@ def action_generate_conda_docker(
output_image_name: str,
output_image_tag: str,
):
if sys.platform != "linux":
raise RuntimeError(
"Generating Docker images is currently only supported on Linux"
)
# Upstream issue in conda-docker, see
# https://github.com/conda-incubator/conda-store/issues/666
raise RuntimeError("Generating Docker images is currently not supported")

# Import is inside the function because conda_docker is only available on
# Linux
from conda_docker.conda import (
build_docker_environment_image,
conda_info,
fetch_precs,
find_user_conda,
precs_from_environment_prefix,
)
# # Import is inside the function because conda_docker is only available on
# # Linux
# from conda_docker.conda import (
# build_docker_environment_image,
# conda_info,
# fetch_precs,
# find_user_conda,
# precs_from_environment_prefix,
# )

user_conda = find_user_conda()
info = conda_info(user_conda)
download_dir = info["pkgs_dirs"][0]
precs = precs_from_environment_prefix(str(conda_prefix), download_dir, user_conda)
records = fetch_precs(download_dir, precs)
base_image = container_registry.pull_image(default_docker_image)
image = build_docker_environment_image(
base_image=base_image,
output_image=f"{output_image_name}:{output_image_tag}",
records=records,
default_prefix=info["env_vars"]["CONDA_ROOT"],
download_dir=download_dir,
user_conda=user_conda,
channels_remap=info.get("channels_remap", []),
layering_strategy="single",
)
return image
# user_conda = find_user_conda()
# info = conda_info(user_conda)
# download_dir = info["pkgs_dirs"][0]
# precs = precs_from_environment_prefix(str(conda_prefix), download_dir, user_conda)
# records = fetch_precs(download_dir, precs)
# base_image = container_registry.pull_image(default_docker_image)
# image = build_docker_environment_image(
# base_image=base_image,
# output_image=f"{output_image_name}:{output_image_tag}",
# records=records,
# default_prefix=info["env_vars"]["CONDA_ROOT"],
# download_dir=download_dir,
# user_conda=user_conda,
# channels_remap=info.get("channels_remap", []),
# layering_strategy="single",
# )
# return image

0 comments on commit bf69e05

Please sign in to comment.