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

DEV - Update dev environments #838

Merged
merged 47 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2cc3c6b
Pin baipp action
trallard Jul 1, 2024
494160b
Update concurrency group
trallard Jul 1, 2024
71a3a78
chore: Update playwright installation command to include dependencies
trallard Jul 1, 2024
74f9066
Update OS versions for unit testing in test_conda_store_server_unit.…
trallard Jul 1, 2024
3cc82f9
Remove runtime dependencies from environment-dev.yaml
trallard Jul 1, 2024
17604c3
Update installation command for conda-store server
trallard Jul 1, 2024
15bbcba
📌 Pin conda back again
trallard Jul 2, 2024
e3d6a13
Simplify workflow for debugging
trallard Jul 3, 2024
4c62c2f
Avoid python call fails
trallard Jul 3, 2024
359b202
Commenting env for debugging
trallard Jul 3, 2024
645116d
Capture subprocess errors in tests
trallard Jul 3, 2024
ead3fc3
Remove debug comments
trallard Jul 3, 2024
f15e622
:construction_worker: Add linting back to workflow
trallard Jul 3, 2024
a8b5445
:pushpin: Fix dependency pin - sqlalchemy
trallard Jul 3, 2024
a3c79d6
Remove Windows and Mac for now
trallard Jul 3, 2024
e5ea78c
Remove conda pin
trallard Jul 3, 2024
d08491e
Update conda-store workflow - align with rest
trallard Jul 3, 2024
a361a8c
:construction_worker: Only upload artefacts when needed
trallard Jul 3, 2024
8069f5c
Remove unnecessary env files
trallard Jul 3, 2024
3336d10
Merge branch 'main' into trallard/update-dev-environments
trallard Jul 4, 2024
d2a6d2c
Remove workflow STDERR env var
trallard Jul 4, 2024
0024672
DEV - Simplify Docker images (#841)
trallard Jul 5, 2024
e8956f4
DEV - Set a canonical default Python version (3.12) (#844)
trallard Jul 8, 2024
01176e7
Merge branch 'main' into trallard/update-dev-environments
peytondmurray Jul 23, 2024
cd92d54
Added celery worker to test_add_lockfile_packages for testing...
peytondmurray Jul 23, 2024
31c51a0
Test adding conda lock spec to db
peytondmurray Jul 23, 2024
52219de
Merge branch 'main' into trallard/update-dev-environments
peytondmurray Jul 23, 2024
9c03baa
Fix potential issue with popping `CONDA_FLAGS` env var
peytondmurray Jul 23, 2024
91bcb95
Add tmate action for debugging the runner
peytondmurray Jul 24, 2024
15191c7
Safeguard against missing lockfile; ensure empty logs concat properly
peytondmurray Jul 24, 2024
fdc5a05
Reenable all unit tests; remove conda lockfile existence check
peytondmurray Jul 24, 2024
44030f2
Revert to old environment setting method
peytondmurray Jul 24, 2024
1f0530c
Reenable tmate
peytondmurray Jul 24, 2024
d9c0322
Remove tmate
peytondmurray Jul 24, 2024
c3f4744
Fix invalid escape sequence in generate_constructor_installer
peytondmurray Jul 24, 2024
1c4c160
Add tmate back in
peytondmurray Jul 24, 2024
f4378e6
Explicitly tell conda to run tests with the expected environment
peytondmurray Jul 24, 2024
63df5db
Remove superfluous print; add DebuggingException with more context
peytondmurray Jul 24, 2024
9cd2c3d
Use simple specification in test
peytondmurray Jul 24, 2024
c5a10f7
Revert debugging changes
peytondmurray Jul 24, 2024
8c9926b
Merge branch 'main' into trallard/update-dev-environments
trallard Aug 9, 2024
b80ba37
Update conda-store-server/Dockerfile
trallard Aug 9, 2024
0f82099
Fix server_app import
trallard Aug 9, 2024
6952c3a
[pre-commit.ci] Apply automatic pre-commit fixes
pre-commit-ci[bot] Aug 9, 2024
de01dc2
Fix Docker base image
trallard Aug 9, 2024
85d7885
Remove Docker compose v1 references
trallard Aug 9, 2024
43e93dd
Revert to docker-compose in env file
trallard Aug 9, 2024
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
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# Git
.git
.gitignore
.gitattributes

# Docker
docker-compose.yml
Dockerfile
.docker
.dockerignore

# python
**/__pycache__
dist
build
*.egg-info
.pytest_cache

# VSCode
.vscode/

# MacOS
**/.DS_Store

# playwright
screenshots
test-results

# ruff
.ruff_cache

# conda-store-ui
conda-store-server/conda_store_server/server/static/conda-store-ui/

# Docusaurus dependencies
/node_modules

# Docusaurus production
/build

# markdown
*.md
!README.md

# ------------------------
# conda-store specific
data
examples/docker/data

# test files
conda-store-server/tests
conda-store/tests
12 changes: 12 additions & 0 deletions .github/workflows/build_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: "Get project's default Python version 🏷️"
run: |
echo "PYTHON_VERSION_DEFAULT=$(cat .python-version-default)" >> $GITHUB_ENV

- name: "Retrieve secret from Vault 🗝"
uses: hashicorp/vault-action@v3
with:
Expand Down Expand Up @@ -68,6 +72,12 @@ jobs:
type=ref,event=tag
type=sha

# we need this as we are setting the context to subproject directory
- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
shell: bash

- name: "Publish Docker image 🚀"
uses: docker/build-push-action@v5
with:
Expand All @@ -80,4 +90,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
python_version=${{ env.PYTHON_VERSION_DEFAULT }}
platforms: ${{ matrix.platform }}
7 changes: 2 additions & 5 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- macos-14
- windows-latest
# ubuntu 22.04, macos 14, windows 2022
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ permissions:
jobs:
# Always build & verify package.
build-package:
name: Build & verify package
name: "Build & verify package"
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -39,7 +39,7 @@ jobs:
- run: echo "Running on ${{ matrix.directory }}"

- name: "Check package build - ${{ matrix.directory }} 📦"
uses: hynek/build-and-inspect-python-package@main
uses: hynek/build-and-inspect-python-package@v2
with:
path: ${{ matrix.directory }}
upload-name-suffix: "-${{ matrix.directory }}"
Expand All @@ -55,7 +55,7 @@ jobs:

# Upload to Test PyPI on every commit on main
release-test-pypi:
name: Publish in-dev to test.pypi.org
name: "Publish in-dev to test.pypi.org"
environment: release-test-pypi
if: github.repository_owner == 'conda-incubator' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand All @@ -82,9 +82,9 @@ jobs:
print-hash: true
verbose: true


# Upload to PyPI on every tag/release
release-pypi:
name: Publish released package to pypi.org
name: "Publish released package to pypi.org"
environment: release-pypi
if: github.repository_owner == 'conda-incubator' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,6 +128,15 @@ jobs:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: "Get project's default Python version 🏷️"
run: |
echo "PYTHON_VERSION_DEFAULT=$(cat .python-version-default)" >> $GITHUB_ENV

- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
shell: bash

- name: "Retrieve secret from Vault 🗝"
uses: hashicorp/vault-action@v2
with:
Expand Down Expand Up @@ -177,6 +186,7 @@ jobs:
file: "${{ matrix.docker-image }}/Dockerfile"
build-args: |
RELEASE_VERSION=${{github.ref_name}}
python_version=${{ env.PYTHON_VERSION_DEFAULT }}
tags: |
${{ steps.meta.outputs.tags }}
push: true
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/test_build_docker_image.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Test build Docker image"

env:
DEFAULT_PYTHON_VERSION: "3.10"
FORCE_COLOR: "1" # Make tools pretty.
PYTHONUNBUFFERED: "1" # Make stdout and stderr behave well

on:
pull_request:
Expand All @@ -20,7 +20,7 @@ on:

# ensuring only one instance is running at a given time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
Expand All @@ -39,7 +39,11 @@ jobs:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: "Set up Docker Buildx"
- name: "Get project's default Python version 🏷️"
run: |
echo "PYTHON_VERSION_DEFAULT=$(cat .python-version-default)" >> $GITHUB_ENV

- name: "Set up Docker Buildx 🏗"
uses: docker/setup-buildx-action@v3

- name: "Lint Dockerfiles 🔍"
Expand All @@ -49,7 +53,12 @@ jobs:
output_format: tty
error_level: 0

- name: "Docker Meta"
- name: "Copy .dockerignore"
run: |
cp .dockerignore ${{ matrix.docker-image }}/.dockerignore
shell: bash

- name: "Add Docker metadata 📝"
id: meta
uses: docker/metadata-action@v5
with:
Expand All @@ -58,7 +67,7 @@ jobs:
tags: |
type=sha

- name: "Build Docker images"
- name: "Build Docker images 🐳"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
Expand All @@ -70,4 +79,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
python_version=${{ env.PYTHON_VERSION_DEFAULT }}
platforms: ${{ matrix.platform }}
21 changes: 8 additions & 13 deletions .github/workflows/test_conda_store.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Test conda-store"

env:
DEFAULT_PYTHON_VERSION: "3.10"
FORCE_COLOR: "1" # Make tools pretty.
PYTHONUNBUFFERED: "1" # Make stdout and stderr behave well

on:
pull_request:
Expand All @@ -20,7 +20,7 @@ on:

# ensuring only one instance is running at a given time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
Expand All @@ -40,22 +40,21 @@ jobs:
- name: "Set up Python 🐍"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version-file: .python-version-default
cache: "pip"

- name: "Install Dependencies 📦"
run: |
pip install hatch
sudo apt install wait-for-it -y
python -m pip install hatch
# install conda-store
pip install .

- name: "Linting Checks 🧹"
run: |
hatch env run -e lint lint

- name: "Build package 📦"
run: |
hatch build

- name: "Deploy docker-compose"
- name: "Deploy docker-compose 🏗️"
run: |
docker-compose up -d
docker ps
Expand All @@ -64,10 +63,6 @@ jobs:
wait-for-it localhost:9000 # minio
wait-for-it localhost:8080 # conda-store-server

- name: "Install conda-store for tests 📦"
run: |
pip install .

- name: "Run basic tests - not authenticated"
run: |
sleep 20
Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/test_conda_store_server_integration.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Test conda-store-server (integration)"

env:
DEFAULT_PYTHON_VERSION: "3.10"
FORCE_COLOR: "1" # Make tools pretty.
PYTHONUNBUFFERED: "1" # Make stdout and stderr behave well

on:
pull_request:
Expand All @@ -20,12 +20,12 @@ on:

# ensuring only one instance is running at a given time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
integration-test-conda-store-server:
name: "integration-test conda-store-server"
name: "integration-test - ${{ matrix.test-type }}"
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -38,18 +38,27 @@ jobs:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: "Set up env 🐍"
- name: "Get project's default Python version 🏷️"
run: |
echo "PYTHON_VERSION_DEFAULT=$(cat .python-version-default)" >> $GITHUB_ENV

- name: "Set up conda env 🐍"
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: conda-store-server/environment-dev.yaml
miniforge-version: latest
environment-file: conda-store-server/environment-dev.yaml
miniforge-version: latest
auto-activate-base: false
activate-environment: conda-store-server-dev
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}

- name: "Install build dependencies 📦"
- name: "Install dependencies 📦"
run: |
pip install hatch
which python
sudo apt install wait-for-it -y
# install conda-store-server
python -m pip install .

- name: "Deploy docker-compose"
- name: "Deploy docker-compose 🏗️"
run: |
docker-compose up -d
docker ps
Expand All @@ -61,26 +70,25 @@ jobs:

- name: "Run Playwright tests 🎭"
run: |
playwright install
pytest --video on ../tests/test_playwright.py
python -m playwright install --with-deps chromium
python -m pytest --video on ../tests/test_playwright.py
if: matrix.test-type == 'playwright'

- name: "Upload test results 📤"
uses: actions/upload-artifact@v4
if: ${{ always() }} && matrix.test-type == 'playwright'
if: matrix.test-type == 'playwright'
with:
name: playwright-tests
path: conda-store-server/test-results

- name: "Run integration tests ✅"
run: |
export PYTHONPATH=$PYTHONPATH:$PWD
pytest ../tests/test_api.py ../tests/test_metrics.py
python -m pytest ../tests/test_api.py ../tests/test_metrics.py
if: matrix.test-type == 'integration'

- name: "Run user journey tests ✅"
run: |
pytest -m "user_journey"
python -m pytest -m "user_journey"
if: matrix.test-type == 'user-journey'

- name: "Get Docker logs 🔍"
Expand Down
Loading
Loading