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

BUG fix keys zipped with docker image #1434

Merged
merged 8 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: tests

on:
push: null
push:
branches:
- master
pull_request: null

jobs:
Expand Down Expand Up @@ -37,5 +39,5 @@ jobs:
run: |
coverage combine || echo "no coverage data to combine maybe"
coveralls
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ def finalize_config(config, platform, arch, forge_config):
config["docker_image"] = [config["docker_image"][0]]
else:
config["docker_image"] = [forge_config["docker"]["fallback_image"]]

if "zip_keys" in config:
for ziplist in config["zip_keys"]:
if "docker_image" in ziplist:
for key in ziplist:
if key != "docker_image":
config[key] = [config[key][0]]

return config


Expand Down
25 changes: 25 additions & 0 deletions news/cdt_name.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* All keys zipped with ``docker_image`` are now handled properly.
* Changed CI configuration to not run tests on ``push`` events to branches that
are not ``master``.

**Security:**

* <news item>
13 changes: 13 additions & 0 deletions tests/recipes/cuda_docker_images/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
cdt_name: # [linux64]
- cos6 # [linux64]
- cos6 # [linux64]
- cos6 # [linux64]
- cos6 # [linux64]
- cos6 # [linux64]
- cos7 # [linux64]

cuda_compiler: # [linux64]
- nvcc # [linux64]
cuda_compiler_version: # [linux64]
- None # [linux64]
- 9.2 # [linux64]
- 10.0 # [linux64]
- 10.1 # [linux64]
- 10.2 # [linux64]
- 11.0 # [linux64]

docker_image: # [linux64]
- condaforge/linux-anvil-comp7 # [linux64]
- condaforge/linux-anvil-cuda:9.2 # [linux64]
- condaforge/linux-anvil-cuda:10.0 # [linux64]
- condaforge/linux-anvil-cuda:10.1 # [linux64]
- condaforge/linux-anvil-cuda:10.2 # [linux64]
- condaforge/linux-anvil-cuda:11.0 # [linux64]

zip_keys: # [linux64]
- # [linux64]
- cdt_name # [linux64]
- cuda_compiler_version # [linux64]
- docker_image # [linux64]
8 changes: 8 additions & 0 deletions tests/recipes/multiple_docker_images/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ docker_image: # [linux64]
- pickme_a # [linux64]
- pickme_b # [linux64]
- pickme_c # [linux64]
cdt_name: # [linux64]
- pickme_1 # [linux64]
- pickme_2 # [linux64]
- pickme_3 # [linux64]
zip_keys: # [linux64]
- # [linux64]
- docker_image # [linux64]
- cdt_name # [linux64]
10 changes: 7 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import collections
import os
import pytest
import subprocess
import yaml
import shutil
Expand Down Expand Up @@ -131,8 +130,8 @@ def test_init_cuda_docker_images(testing_workdir):
# files, though - loops within outputs are contained in those top-level
# configs.
matrix_dir_len = len(os.listdir(matrix_dir))
assert matrix_dir_len == 5
for v in [None, "9.2", "10.0", "10.1"]:
assert matrix_dir_len == 7 # 6 docker images plus the README
for v in [None, "9.2", "10.0", "10.1", "10.2", "11.0"]:
fn = os.path.join(
matrix_dir, f"linux_64_cuda_compiler_version{v}.yaml"
)
Expand All @@ -146,6 +145,10 @@ def test_init_cuda_docker_images(testing_workdir):
else:
docker_image = f"condaforge/linux-anvil-cuda:{v}"
assert config["docker_image"] == [docker_image]
if v == "11.0":
assert config["cdt_name"] == ["cos7"]
else:
assert config["cdt_name"] == ["cos6"]


def test_init_multiple_docker_images(testing_workdir):
Expand Down Expand Up @@ -186,6 +189,7 @@ def test_init_multiple_docker_images(testing_workdir):
with open(fn) as fh:
config = yaml.load(fh)
assert config["docker_image"] == ["pickme_a"]
assert config["cdt_name"] == ["pickme_1"]


def test_regenerate(py_recipe, testing_workdir):
Expand Down