Skip to content

Commit

Permalink
MAINT - Pre release docs and improvements (#580)
Browse files Browse the repository at this point in the history
* 📌 Pin Docker base images

* 🔧 Update pyproject.toml

* 📝 Update release docs

* 👷 Update GH actions

* 📝 Finish docs

* 📝 Add note to update ui version

* Fix some typos

* 🔧 Improvements to Dockerfiles

🔧 Improvements to Dockerfiles

* 📝 Update changelog example
  • Loading branch information
trallard authored Sep 19, 2023
1 parent 432eaa1 commit f3a895d
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Feature request"
name: "Feature request"
description: "Create a feature request to help us improve"
title: "[ENH] - <title>"
labels: ["type: enhancement 💅"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: "Deploy image"
name: "Publish Docker Images"

on:
push:
branches:
- "main"
tags:
- "v*"
release:
types: [created]

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
build_and_push_docker_image:
name: "Build Docker Images"
name: "Build Docker Images 🛠"
runs-on: ubuntu-latest
strategy:
matrix:
docker-image:
- conda-store
- conda-store-server
steps:
- name: "Checkout Repository"
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: Retrieve secret from Vault
- name: "Retrieve secret from Vault 🗝"
uses: hashicorp/vault-action@v2
with:
method: jwt
Expand All @@ -37,23 +37,23 @@ jobs:
kv/data/repository/conda-incubator/conda-store/shared_secrets QUAY_QUANSIGHT_USERNAME | QUAY_USERNAME;
kv/data/repository/conda-incubator/conda-store/shared_secrets QUAY_QUANSIGHT_PASSWORD | QUAY_PASSWORD;
- name: Set up Docker Buildx
- name: "Set up Docker Buildx 🏗"
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
- name: "Login to Docker Hub 🐳"
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

- name: Login to quay.io
- name: "Login to quay.io 🐳"
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ env.QUAY_USERNAME }}
password: ${{ env.QUAY_PASSWORD }}

- name: Docker Meta
- name: "Add Docker metadata 📝"
id: meta
uses: crazy-max/ghaction-docker-meta@v5
with:
Expand All @@ -65,7 +65,7 @@ jobs:
type=ref,event=branch
type=sha
- name: Build docker
- name: "Publish Docker image 🚀"
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: "Release"
name: "Release conda-store"

on:
push:
tags:
- "v*"
release:
types: [created]

permissions:
contents: read # This is required for actions/checkout

jobs:
release-conda-store:
name: "PyPi Release conda-store-server"
name: "PyPi Release conda-store packages 🚀"
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
Expand All @@ -23,21 +22,21 @@ jobs:
run:
working-directory: ${{ matrix.directory }}
steps:
- name: "Checkout Repository"
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4

- name: Set up Python
- name: "Set up Python 🐍"
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install hatch
- name: "Install hatch 🐣"
run: |
pip install hatch
- name: Build Package
- name: "Build Package 📦"
run: |
hatch build
- name: Upload to PyPI
- name: "Upload to PyPI 🚀"
uses: pypa/gh-action-pypi-publish@release/v1
31 changes: 22 additions & 9 deletions conda-store-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
FROM --platform=linux/amd64 condaforge/mambaforge
FROM --platform=linux/amd64 condaforge/mambaforge:23.3.1-1

RUN apt-get update \
LABEL org.opencontainers.image.authors="conda-store development team"

RUN apt-get update && \
# https://docs.anaconda.org/anaconda/install/linux/#installing-on-linux
&& apt-get install -y libgl1-mesa-glx libegl1-mesa libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 \
apt-get install -yq --no-install-recommends \
libgl1-mesa-glx \
libegl1-mesa \
libxrandr2 \
libxss1 \
libxcursor1 \
libxcomposite1 \
libasound2 \
libxi6 \
libxtst6 \
# needed only for development
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*
curl && \
apt-get clean && \
rm -rf /var/cache/apt/* &&\
rm -rf /var/lib/apt/lists/* &&\
rm -rf /tmp/*

# ensure that conda channels is empty by default
# we do not want to tamper with the solve
RUN printf 'channels: []\n' > /opt/conda/.condarc

RUN chown -R 1000:1000 /opt/conda && \
# we do not want to tamper with the solve≈
RUN printf 'channels: []\n' > /opt/conda/.condarc && \
chown -R 1000:1000 /opt/conda && \
mkdir -p /opt/conda-store/conda-store && \
chown 1000:1000 /opt/conda-store/conda-store && \
mkdir -p /var/lib/conda-store && \
Expand Down
2 changes: 1 addition & 1 deletion conda-store-server/conda_store_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.15"
__version__ = "2023.9.1rc0"
2 changes: 1 addition & 1 deletion conda-store-server/hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from hatchling.builders.hooks.plugin.interface import BuildHookInterface

CONDA_STORE_UI_VERSION = "0.1.4"
CONDA_STORE_UI_VERSION = "0.1.5"
CONDA_STORE_UI_URL = f"https://registry.npmjs.org/@conda-store/conda-store-ui/-/conda-store-ui-{CONDA_STORE_UI_VERSION}.tgz"
CONDA_STORE_UI_FILES = [
"main.js",
Expand Down
31 changes: 13 additions & 18 deletions conda-store-server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build-system]
requires = ["hatchling>=1.14.0"]
# https://github.com/ofek/hatch-vcs
requires = ["hatchling>=1.14.0", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
Expand All @@ -8,9 +9,7 @@ description = "Conda Environment Management, Builds, and Serve"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.7"
keywords = [
"conda",
]
keywords = ["conda"]
authors = [
{ name = "Christopher Ostrouchov", email = "[email protected]" },
]
Expand All @@ -20,9 +19,10 @@ classifiers = [
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]
dependencies = [
Expand All @@ -44,22 +44,20 @@ dependencies = [
"jinja2",
"python-multipart",
# conda (which should not be included here)

]
dynamic = ["version"]

[project.urls]
Homepage = "https://conda.store/"
Source = "https://github.com/conda-incubator/conda-store"

[project.optional-dependencies]
dev = [
"build",
"twine",
]

[tool.hatch.version]
path = "conda_store_server/__init__.py"

[project.optional-dependencies]
dev = ["build", "twine"]

[tool.hatch.envs.dev]
dependencies = [
"pre-commit",
Expand All @@ -74,18 +72,14 @@ dependencies = [
]

[tool.hatch.envs.dev.scripts]
lint = [
"pre-commit run --all",
]
lint = ["pre-commit run --all"]
docs = "sphinx-build -b html ../docs ../docs/_build"
unit-test = "pytest tests -v"
playwright-test = [
"playwright install",
"pytest --video on ../tests/test_playwright.py"
]
integration-test = [
"pytest ../tests/test_api.py ../tests/test_metrics.py"
]
integration-test = ["pytest ../tests/test_api.py ../tests/test_metrics.py"]

[tool.hatch.build.hooks.custom]

Expand All @@ -101,5 +95,6 @@ target-version = ['py37', 'py38', 'py39']

[tool.ruff]
ignore = [
"E501", # line-length
"E501", # line-length

]
13 changes: 9 additions & 4 deletions conda-store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
FROM --platform=linux/amd64 condaforge/mambaforge
FROM --platform=linux/amd64 condaforge/mambaforge:23.3.1-1

LABEL org.opencontainers.image.authors="conda-store development team"

USER root

RUN apt-get update \
&& apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -yq --no-install-recommends curl && \
apt-get clean && \
rm -rf /var/cache/apt/* &&\
rm -rf /var/lib/apt/lists/* &&\
rm -rf /tmp/*

COPY environment.yaml /opt/conda-store/environment.yaml

Expand Down
2 changes: 1 addition & 1 deletion conda-store/conda_store/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.15"
__version__ = "2023.9.1rc0"
42 changes: 19 additions & 23 deletions conda-store/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build-system]
requires = ["hatchling>=1.14.0"]
# https://github.com/ofek/hatch-vcs
requires = ["hatchling>=1.14.0", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
Expand All @@ -8,45 +9,41 @@ description = "conda-store client"
readme = "README.md"
license = "BSD-3-Clause"
requires-python = ">=3.7"
keywords = [
"conda",
]
keywords = ["conda"]
authors = [
{ name = "Christopher Ostrouchov", email = "[email protected]" },
]
maintainers = [{ name = "Tania Allard", email = "[email protected]" }]
# TODO: update maintainers
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
]
dependencies = [
"rich",
"click",
"yarl",
"aiohttp",
"ruamel.yaml",
]
dependencies = ["rich", "click", "yarl", "aiohttp", "ruamel.yaml"]
dynamic = ["version"]

[project.urls]
Homepage = "https://conda.store/"
Source = "https://github.com/conda-incubator/conda-store"

[project.optional-dependencies]
dev = [
"build",
"twine",
]

[tool.hatch.version]
path = "conda_store/__init__.py"

[project.optional-dependencies]
dev = ["build", "twine"]

[tool.hatch.envs.dev]
dependencies = [
"pre-commit",
Expand All @@ -60,9 +57,7 @@ dependencies = [
]

[tool.hatch.envs.dev.scripts]
lint = [
"pre-commit run --all",
]
lint = ["pre-commit run --all"]
docs = "sphinx-build -b html ../docs ../docs/_build"
test = "pytest tests"

Expand All @@ -71,9 +66,10 @@ conda-store = "conda_store.__main__:main"

[tool.black]
line-length = 88
target-version = ['py37', 'py38', 'py39']
target-version = ['py38', 'py39', 'py310']

[tool.ruff]
ignore = [
"E501", # line-length
"E501", # line-length

]
Loading

0 comments on commit f3a895d

Please sign in to comment.