小编Amy*_*Amy的帖子

使用 Shell Executor 在 CI-CD 的 GitLab Config yml 文件中激活 Conda 环境

我想在我的 Gitlab CI-CD 进程中激活 conda 环境。我在与我的工作笔记本电脑不同的本地计算机(UNIX)上使用 Shell Executor 注册了 Gitlab 运行程序(v13.10) 我试图通过我的存储库中存在的环境 yml 文件激活 conda 环境,但它失败并显示 conda 命令未找到!

我编辑了 .gitlab-ci.yml 文件,如下所示:

stages:
  - build
build stage:
    stage: build
    before_script:
        - which python
        - export PIP_CACHE_DIR="/opt/cache/pip"
        - conda env create -f environment.yml
        - source activate env_work
    script:
        - echo "Building"
        - cd parent_dir
        - python main.py new_studies/first_study
    artifacts:
        paths:
            - out/
    only:
        - master
Run Code Online (Sandbox Code Playgroud)

我面临的问题是它抛出一个错误:CONDA Command NOT FOUND

Running with gitlab-runner 13.10.0 (5421146)
  on rig ci runner gZzdceA
Preparing the …
Run Code Online (Sandbox Code Playgroud)

python gitlab anaconda conda gitlab-ci-runner

5
推荐指数
1
解决办法
1924
查看次数

标签 统计

anaconda ×1

conda ×1

gitlab ×1

gitlab-ci-runner ×1

python ×1