From 5eebc1015b87e62ef8bd9a79f8846775fa6b7705 Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 14:46:50 +0300 Subject: [PATCH 1/8] feat: refactor build & rebuild job --- .github/workflows/build-and-rebuild.yaml | 159 +++++------------------ pyproject.toml | 6 + src/repror/build_recipe.py | 14 +- src/repror/conf.py | 8 +- src/repror/convert.py | 14 +- src/repror/rebuild_recipe.py | 39 ++---- src/repror/rewrite_readme.py | 116 ++++++----------- 7 files changed, 111 insertions(+), 245 deletions(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index c666c988..9d1ebbab 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -31,7 +31,7 @@ jobs: echo $message echo "recipes=$message" >> $GITHUB_OUTPUT - build-recipes-ubunutu-22-04: + build-and-rebuild-recipes-ubunutu-22-04: runs-on: ubuntu-22.04 needs: generate-recipes continue-on-error: true @@ -58,88 +58,36 @@ jobs: - name: Build recipes and track if hash is equal run: | - pixi run python src/repror/build_recipe.py ubuntu 22.04 ${{ matrix.recipes }} + pixi run python src/repror/build_recipe.py ${{ matrix.recipes }} - - name: Upload results - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - build_info/ - artifacts/ - - build-recipes-macos-13: - runs-on: macos-13 - needs: matrix - continue-on-error: true - strategy: - matrix: - recipes: ${{ fromJson(needs.genrate-build-recipes.outputs.recipes) }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: prefix-dev/setup-pixi@v0.5.1 - with: - pixi-version: "latest" - - - name: Set timezone to GMT - run: sudo systemsetup -settimezone GMT + - name: Set timezone to PST + run: sudo timedatectl set-timezone America/Los_Angeles - name: Set LANG - run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV + run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV - name: Verify LANG for Initial Build run: echo $LANG - - name: Build recipes and track if hash is equal - run: | - pixi run build-recipe macos 13 ${{ matrix.recipes }} - - - name: Upload results - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - build_info/ - artifacts/ - - build-recipes-windows-2022: - runs-on: windows-latest - needs: matrix - continue-on-error: true - strategy: - matrix: - recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: prefix-dev/setup-pixi@v0.5.1 - with: - pixi-version: "latest" - - - name: Build recipes and track if hash is equal + - name: Rebuild recipes and track if hash is equal run: | - pixi run generate-recipe windows 2022 ${{ matrix.recipes }} + pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} - name: Upload results uses: actions/upload-artifact@v3 with: - name: artifacts + name: build-info path: | build_info/ - artifacts/ + ci_artifacts/ - rebuild-recipes-ubuntu-22-04: - runs-on: ubuntu-22.04 - needs: [build-recipes-ubunutu-22-04, matrix] + build-and-rebuild-recipes-macos-13: + runs-on: macos-13 + needs: generate-recipes continue-on-error: true strategy: matrix: - recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} + recipes: ${{ fromJson(needs.genrate-build-recipes.outputs.recipes) }} steps: - name: Checkout code @@ -149,53 +97,18 @@ jobs: with: pixi-version: "latest" - - uses: actions/download-artifact@v3 - with: - name: artifacts - path: . - - - name: Set timezone to PST - run: sudo timedatectl set-timezone America/Los_Angeles + - name: Set timezone to GMT + run: sudo systemsetup -settimezone GMT - name: Set LANG - run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV + run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - name: Verify LANG for Initial Build run: echo $LANG - - name: Rebuild recipes and track if hash is equal + - name: Build recipes and track if hash is equal run: | - # sudo apt-get install libssl-dev - pixi run python src/repror/rebuild_recipe.py ubuntu 22.04 20.04 ${{ matrix.recipes }} - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: build-info - path: | - build_info/ubuntu - ci_artifacts/ - - rebuild-recipes-macos-13: - runs-on: macos-13 - needs: [build-recipes-macos-13, matrix] - continue-on-error: true - strategy: - matrix: - recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: prefix-dev/setup-pixi@v0.5.1 - with: - pixi-version: "latest" - - - uses: actions/download-artifact@v3 - with: - name: artifacts - path: . + pixi run build-recipe macos 13 ${{ matrix.recipes }} - name: Set timezone to PST run: sudo systemsetup -settimezone America/Los_Angeles @@ -208,20 +121,20 @@ jobs: - name: Rebuild recipes and track if hash is equal run: | - pixi run python src/repror/rebuild_recipe.py macos 13 13 ${{ matrix.recipes }} + pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} - - name: Upload build info + + - name: Upload results uses: actions/upload-artifact@v3 with: name: build-info path: | - build_info/macos - diffoscope_output/ + build_info/ ci_artifacts/ - rebuild-recipes-windows-2022: - runs-on: windows-2022 - needs: [build-recipes-windows-2022, matrix] + build-and-rebuild-recipes-windows-2022: + runs-on: windows-latest + needs: generate-recipes continue-on-error: true strategy: matrix: @@ -235,31 +148,29 @@ jobs: with: pixi-version: "latest" - - uses: actions/download-artifact@v3 - with: - name: artifacts - path: . + - name: Build recipes and track if hash is equal + run: | + pixi run generate-recipe windows 2022 ${{ matrix.recipes }} - name: Rebuild recipes and track if hash is equal run: | - # sudo apt-get install libssl-dev - pixi run python src/repror/rebuild_recipe.py windows 2022 2022 ${{ matrix.recipes }} + pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} - - name: Upload diffoscope + - name: Upload results uses: actions/upload-artifact@v3 with: name: build-info path: | - build_info/ubuntu + build_info/ ci_artifacts/ statistics: runs-on: ubuntu-latest needs: [ - rebuild-recipes-macos-13, - rebuild-recipes-windows-2022, - rebuild-recipes-ubuntu-22-04, + build-and-rebuild-recipes-macos-13, + build-and-rebuild-recipes-windows-2022, + build-and-rebuild-recipes-ubunutu-22-04, ] steps: @@ -280,7 +191,7 @@ jobs: - name: Calculate statistics and plot output run: | - pixi run python src/repror/rewrite_readme.py ubuntu_22.04_20.04 macos_13_12 windows_2022_2019 + pixi run python src/repror/rewrite_readme.py - name: Commit and push changes env: diff --git a/pyproject.toml b/pyproject.toml index bc9498e3..678d219e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,3 +16,9 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] + +[tool.ruff] +# Exclude a variety of commonly ignored directories. +exclude = [ + "recipes/" +] diff --git a/src/repror/build_recipe.py b/src/repror/build_recipe.py index 784d0b60..452fe2fc 100644 --- a/src/repror/build_recipe.py +++ b/src/repror/build_recipe.py @@ -2,6 +2,7 @@ import json import sys import conf +import platform from pathlib import Path import tempfile from repror.build import ( @@ -29,19 +30,16 @@ def build_recipes(recipes: list[Recipe], tmp_dir, build_dir): if __name__ == "__main__": - platform, version = sys.argv[1], sys.argv[2] # this should be optional # so we could run it locally nice - recipe_string = sys.argv[3] + recipe_string = sys.argv[1] + + platform_name, platform_version = platform.system().lower(), platform.release() url, branch, path = recipe_string.split("::") recipe_obj: Recipe = Recipe(url=url, branch=branch, path=path) - if platform not in ["ubuntu", "macos", "windows"]: - print("Invalid platform ", platform) - sys.exit(1) - config = conf.load_config() build_info = {} @@ -58,10 +56,8 @@ def build_recipes(recipes: list[Recipe], tmp_dir, build_dir): os.makedirs("build_info", exist_ok=True) - # build_id = uuid.uuid4().hex - with open( - f"build_info/{platform}_{version}_{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_build_info.json", + f"build_info/{platform_name}_{platform_version}_{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_build_info.json", "w", ) as f: json.dump(build_info, f) diff --git a/src/repror/conf.py b/src/repror/conf.py index 7c2cad42..92dc49ba 100644 --- a/src/repror/conf.py +++ b/src/repror/conf.py @@ -7,12 +7,12 @@ def load_config(config_path: str = "config.yaml"): config = yaml.safe_load(file) return config + def save_config(data, config_path: str = "config.yaml"): with open(config_path, "w", encoding="utf8") as file: yaml.safe_dump(data, file) - class RecipeConfig: def __init__(self, config): self.config = config @@ -28,4 +28,8 @@ def name(self) -> str: if "name" in self.config.get("context", {}): return self.config["context"]["name"] - return self.config["package"]["name"] if "package" in self.config else self.config["recipe"]["name"] + return ( + self.config["package"]["name"] + if "package" in self.config + else self.config["recipe"]["name"] + ) diff --git a/src/repror/convert.py b/src/repror/convert.py index 6708a9aa..71d5f5e9 100644 --- a/src/repror/convert.py +++ b/src/repror/convert.py @@ -6,6 +6,7 @@ import shutil from repror import conf + def checkout_feedstock(package_name, dest_recipe_dir): """ Check out the feedstock repository for the given package name. @@ -22,12 +23,16 @@ def checkout_feedstock(package_name, dest_recipe_dir): print(f"Failed to clone repository: {repo_url}") return None + def apply_crm_convert(dest_recipe_dir, meta_yaml_path): """ Apply the crm convert tool to the given meta.yaml file. """ dest_file = os.path.join(dest_recipe_dir, "recipe.yaml") - subprocess.run(["crm", "convert", meta_yaml_path, "--output", dest_file], check=False) + subprocess.run( + ["crm", "convert", meta_yaml_path, "--output", dest_file], check=False + ) + def save_new_recipe(dest_recipe_dir): """ @@ -36,13 +41,14 @@ def save_new_recipe(dest_recipe_dir): meta_yaml_path = os.path.join(dest_recipe_dir, "meta.yaml") apply_crm_convert(dest_recipe_dir, meta_yaml_path) + def process_packages(package_names): """ Process each package: check out feedstock, apply crm convert, and save new recipe. """ base_dest_dir = os.getcwd() config = conf.load_config() - all_existing_paths = {recipe['path'] for recipe in config['local']} + all_existing_paths = {recipe["path"] for recipe in config["local"]} for package_name in package_names: print(f"Processing package: {package_name}") dest_recipe_dir = os.path.join(base_dest_dir, "recipes", package_name) @@ -58,10 +64,11 @@ def process_packages(package_names): rel_path = os.path.relpath(recipe_path, base_dest_dir) if rel_path not in all_existing_paths: - config['local'].append({'path': rel_path}) + config["local"].append({"path": rel_path}) conf.save_config(config) + if __name__ == "__main__": some_names = sys.argv[1:] @@ -69,5 +76,4 @@ def process_packages(package_names): package_names = some_names or example_names - process_packages(package_names) diff --git a/src/repror/rebuild_recipe.py b/src/repror/rebuild_recipe.py index 93e094ba..f4fbdc5a 100644 --- a/src/repror/rebuild_recipe.py +++ b/src/repror/rebuild_recipe.py @@ -3,12 +3,12 @@ from pathlib import Path import sys import tempfile +import platform from typing import Optional from repror.build import BuildInfo, Recipe, rebuild_package from repror.conf import load_config from repror.rattler_build import setup_rattler_build -from repror.util import find_all_conda_build def rebuild_packages( @@ -35,8 +35,9 @@ def rebuild_packages( if __name__ == "__main__": - platform, previous_version, current_version = sys.argv[1], sys.argv[2], sys.argv[3] - recipe_string = sys.argv[4] + recipe_string = sys.argv[1] + + platform_name, platform_version = platform.system().lower(), platform.release() url, branch, path = recipe_string.split("::") recipe_obj: Recipe = Recipe(url=url, branch=branch, path=path) @@ -48,45 +49,27 @@ def rebuild_packages( setup_rattler_build(config, Path(tmp_dir)) - rebuild_dir = Path("build_outputs") - rebuild_dir.mkdir(exist_ok=True) - - Path(f"ci_artifacts/{platform}/build").mkdir(exist_ok=True, parents=True) - Path(f"ci_artifacts/{platform}/rebuild").mkdir(exist_ok=True, parents=True) + Path(f"ci_artifacts/{platform_name}/build").mkdir(exist_ok=True, parents=True) + Path(f"ci_artifacts/{platform_name}/rebuild").mkdir(exist_ok=True, parents=True) with open( - f"build_info/{platform}_{previous_version}_{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_build_info.json", + f"build_info/{platform_name}_{platform_version}_{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_build_info.json", "r", ) as f: previous_build_info = json.load(f) - rebuild_info = rebuild_packages(previous_build_info, rebuild_dir, platform) - - # get the diffoscope output - all_builds = find_all_conda_build("artifacts") - - for recipe_name in rebuild_info: - if not rebuild_info[recipe_name]: - continue - - rebuilded_loc = rebuild_info[recipe_name]["conda_loc"] - - if Path(rebuilded_loc).name in all_builds: - idx = all_builds.index(Path(rebuilded_loc).name) - built = all_builds[idx] - else: - continue + rebuild_info = rebuild_packages(previous_build_info, tmp_dir, platform_name) - os.makedirs(f"build_info/{platform}", exist_ok=True) + os.makedirs(f"build_info/{platform_name}", exist_ok=True) with open( - f"build_info/{platform}/{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_{platform}_{previous_version}_{current_version}_rebuild_info.json", + f"build_info/{platform_name}/{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_platform_{platform_name}_{platform_version}_rebuild_info.json", "w", ) as f: json.dump(rebuild_info, f) with open( - f"build_info/{platform}/{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_{platform}_{previous_version}_build_info.json", + f"build_info/{platform_name}/{recipe_string.replace("/", "_").replace("::", "_").replace(":", "_")}_platform_{platform_name}_{platform_version}_build_info.json", "w", ) as f: json.dump(previous_build_info, f) diff --git a/src/repror/rewrite_readme.py b/src/repror/rewrite_readme.py index 0bf49bfd..e48af1c6 100644 --- a/src/repror/rewrite_readme.py +++ b/src/repror/rewrite_readme.py @@ -1,77 +1,57 @@ +from collections import defaultdict import datetime import glob import json +import logging import os -from pathlib import Path -import sys import tempfile import matplotlib.pyplot as plt from repror.conf import load_config -def find_build_infos(folder_path: str, suffix: str): +def find_infos(folder_path: str, suffix: str): """ Use glob to find all .json files in the folder """ - json_files = glob.glob(os.path.join(folder_path, f"*{suffix}_build_info.json")) + json_files = glob.glob(os.path.join(folder_path, f"*/**{suffix}.json")) return json_files -def find_rebuild_info(folder_path: str, suffix: str): - """ - Use glob to find all .json files in the folder - """ - json_files = glob.glob(os.path.join(folder_path, f"*{suffix}_rebuild_info.json")) - return json_files - - -def make_statistics(platform_with_versions: list[str], temp_dir: str) -> Path: - build_info_by_platform = {} - rebuild_info_by_platform = {} +def make_statistics(build_info_dir: str = "build_info") -> dict: + build_info_by_platform = defaultdict(dict) + rebuild_info_by_platform = defaultdict(dict) total_build_info = {} total_rebuild_info = {} - for platform_and_version in platform_with_versions: - base_platform, from_version, to_version = platform_and_version.split("_") + build_infos = find_infos(build_info_dir, "build_info") - build_info_by_platform[base_platform] = {} - build_info_files = find_build_infos( - f"build_info/{base_platform}", f"{base_platform}_{from_version}" - ) + for build_file in build_infos: + platform_and_version = build_file.split("platform_")[1] + platform, *_ = platform_and_version.split("_") - for file in build_info_files: - with open(file, "r") as f: - build_info_by_platform[base_platform].update(json.load(f)) + with open(build_file, "r") as f: + build_info_by_platform[platform].update(json.load(f)) - rebuild_info_files = find_rebuild_info( - f"build_info/{base_platform}", - f"{base_platform}_{from_version}_{to_version}", - ) + rebuild_infos = find_infos(build_info_dir, "rebuild_info") - rebuild_info_by_platform[base_platform] = {} + for rebuild_file in rebuild_infos: + platform_and_version = build_file.split("platform_")[1] + platform, *_ = platform_and_version.split("_") - for file in rebuild_info_files: - with open(file, "r") as f: - rebuild_info_by_platform[base_platform].update(json.load(f)) + with open(rebuild_file, "r") as f: + rebuild_info_by_platform[platform].update(json.load(f)) - if base_platform == "ubuntu": - total_build_info.update(build_info_by_platform["ubuntu"]) - total_rebuild_info.update(rebuild_info_by_platform["ubuntu"]) + if platform == "linux": + total_build_info.update(build_info_by_platform["linux"]) + total_rebuild_info.update(rebuild_info_by_platform["linux"]) # calculate entire statistics that will be used to render main table assert len(total_build_info) == len(total_rebuild_info) - today_date = datetime.datetime.now().strftime("%Y-%m-%d") - build_results_by_platform = {} - stat_data_dir = Path(os.path.join(temp_dir, "stat_data")) - - # we should fail if it's already present - stat_data_dir.mkdir(parents=True) - for platform in build_info_by_platform: build_results_by_platform[platform] = {} for recipe_name, info in build_info_by_platform[platform].items(): @@ -89,43 +69,27 @@ def make_statistics(platform_with_versions: list[str], temp_dir: str) -> Path: info["pkg_hash"] == re_info["pkg_hash"] ) - with open( - f"{stat_data_dir}/{platform}_packages_info_{today_date}.json", "w" - ) as pkg_info: - json.dump(build_results_by_platform[platform], pkg_info) - - return stat_data_dir + return build_results_by_platform -def plot(platforms, stat_dir: Path): +def plot(build_results_by_platform): now_date = datetime.datetime.now().strftime("%Y-%m-%d") - by_platform = {} - ubuntu_platform = {} - for platform in platforms: - with open(f"{stat_dir}/{platform}_packages_info_{now_date}.json", "r") as f: - platform_build_info = json.load(f) - - by_platform[platform] = platform_build_info - - if platform == "ubuntu": - ubuntu_platform = platform_build_info - with open("data/history.json", "r+") as history_file: previous_data = json.load(history_file) now_date = str(datetime.datetime.now().strftime("%Y-%m-%d")) now_platform = {} - for platform in by_platform: - total_packages = len(by_platform[platform]) + for platform in build_results_by_platform: + total_packages = len(build_results_by_platform[platform]) reproducible = sum( - value for value in by_platform[platform].values() if value + 1 for value in build_results_by_platform[platform].values() if value ) not_reproducible = sum( - value for value in by_platform[platform].values() if not value + 1 for value in build_results_by_platform[platform].values() if not value ) now_platform[platform] = { "total_packages": total_packages, @@ -149,7 +113,11 @@ def plot(platforms, stat_dir: Path): # we take ubuntu as a base image for date in previous_data: - info = previous_data[date]["ubuntu"] + if "linux" not in previous_data[date]: + logging.warning(f"Skipping date {date} as linux is missing ") + continue + + info = previous_data[date]["linux"] dates.append(date) total_packages.append(info["total_packages"]) reproducible.append(info["repro"]) @@ -205,7 +173,7 @@ def plot(platforms, stat_dir: Path): rebuild_table = f"""{table}\n\n""" - for platform in by_platform: + for platform in build_results_by_platform: build_text = f"Built on {platform}" if platform == "macos": build_text += " 13 and rebuilt" @@ -220,7 +188,7 @@ def plot(platforms, stat_dir: Path): | Recipe Name | Is Reproducible | | --- | --- |\n""" - for recipe, reproducible in by_platform[platform].items(): + for recipe, reproducible in build_results_by_platform[platform].items(): rebuild_table += f"| {recipe} | {'Yes 🟢' if reproducible else 'No 🔴'} |\n" # Save the table to README.md @@ -229,15 +197,7 @@ def plot(platforms, stat_dir: Path): if __name__ == "__main__": - platform_with_versions = sys.argv[1:] - - if "ubuntu_22.04_20.04" not in platform_with_versions: - print( - "ubuntu_22.04_20.04 platform is required, for now, to calculate total statistics" - ) - sys.exit(1) - with tempfile.TemporaryDirectory() as tmp_dir: - stat_dir = make_statistics(platform_with_versions, tmp_dir) - platforms = [platform.split("_")[0] for platform in platform_with_versions] - plot(platforms, stat_dir) + build_results_by_platform = make_statistics(tmp_dir) + + plot(build_results_by_platform) From c00fdab8db0d48b468bfb7b6ccfd10178d61afae Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:02:42 +0300 Subject: [PATCH 2/8] misc: use only one job --- .github/workflows/build-and-rebuild.yaml | 122 ++++------------------- 1 file changed, 18 insertions(+), 104 deletions(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index 9d1ebbab..2ef26682 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -31,63 +31,15 @@ jobs: echo $message echo "recipes=$message" >> $GITHUB_OUTPUT - build-and-rebuild-recipes-ubunutu-22-04: - runs-on: ubuntu-22.04 + build-and-rebuild-recipes: needs: generate-recipes continue-on-error: true strategy: matrix: recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} + os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: prefix-dev/setup-pixi@v0.5.1 - with: - pixi-version: "latest" - - - name: Set timezone to UTC - run: sudo timedatectl set-timezone UTC - - - name: Set LANG - run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - - - name: Verify LANG for Initial Build - run: echo $LANG - - - name: Build recipes and track if hash is equal - run: | - pixi run python src/repror/build_recipe.py ${{ matrix.recipes }} - - - name: Set timezone to PST - run: sudo timedatectl set-timezone America/Los_Angeles - - - name: Set LANG - run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV - - - name: Verify LANG for Initial Build - run: echo $LANG - - - name: Rebuild recipes and track if hash is equal - run: | - pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} - - - name: Upload results - uses: actions/upload-artifact@v3 - with: - name: build-info - path: | - build_info/ - ci_artifacts/ - - build-and-rebuild-recipes-macos-13: - runs-on: macos-13 - needs: generate-recipes - continue-on-error: true - strategy: - matrix: - recipes: ${{ fromJson(needs.genrate-build-recipes.outputs.recipes) }} + runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -97,64 +49,31 @@ jobs: with: pixi-version: "latest" - - name: Set timezone to GMT - run: sudo systemsetup -settimezone GMT + # - name: Set timezone to UTC + # run: sudo timedatectl set-timezone UTC - - name: Set LANG - run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV + # - name: Set LANG + # run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - - name: Verify LANG for Initial Build - run: echo $LANG + # - name: Verify LANG for Initial Build + # run: echo $LANG - name: Build recipes and track if hash is equal run: | - pixi run build-recipe macos 13 ${{ matrix.recipes }} - - - name: Set timezone to PST - run: sudo systemsetup -settimezone America/Los_Angeles - - - name: Set LANG - run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV - - - name: Verify LANG for Initial Build - run: echo $LANG - - - name: Rebuild recipes and track if hash is equal - run: | - pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} - - - - name: Upload results - uses: actions/upload-artifact@v3 - with: - name: build-info - path: | - build_info/ - ci_artifacts/ + pixi run build-recipe ${{ matrix.recipes }} - build-and-rebuild-recipes-windows-2022: - runs-on: windows-latest - needs: generate-recipes - continue-on-error: true - strategy: - matrix: - recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} + # - name: Set timezone to PST + # run: sudo timedatectl set-timezone America/Los_Angeles - steps: - - name: Checkout code - uses: actions/checkout@v2 + # - name: Set LANG + # run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV - - uses: prefix-dev/setup-pixi@v0.5.1 - with: - pixi-version: "latest" - - - name: Build recipes and track if hash is equal - run: | - pixi run generate-recipe windows 2022 ${{ matrix.recipes }} + # - name: Verify LANG for Initial Build + # run: echo $LANG - name: Rebuild recipes and track if hash is equal run: | - pixi run python src/repror/rebuild_recipe.py ${{ matrix.recipes }} + pixi run rebuild-recipe ${{ matrix.recipes }} - name: Upload results uses: actions/upload-artifact@v3 @@ -166,12 +85,7 @@ jobs: statistics: runs-on: ubuntu-latest - needs: - [ - build-and-rebuild-recipes-macos-13, - build-and-rebuild-recipes-windows-2022, - build-and-rebuild-recipes-ubunutu-22-04, - ] + needs: build-and-rebuild-recipes steps: - name: Checkout code From 05bf7f2bd4ed113280a1b58a754580855893db2c Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:09:02 +0300 Subject: [PATCH 3/8] misc: add pixi lock --- pixi.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/pixi.lock b/pixi.lock index d4e215c3..76f12513 100644 --- a/pixi.lock +++ b/pixi.lock @@ -819,6 +819,12 @@ packages: - pkg:pypi/certifi size: 160559 timestamp: 1707022289175 +- kind: pypi + name: charset-normalizer + version: 3.3.2 + url: https://files.pythonhosted.org/packages/b6/7c/8debebb4f90174074b827c63242c23851bdf00a532489fba57fef3416e40/charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl + sha256: 96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001 + requires_python: '>=3.7.0' - kind: pypi name: charset-normalizer version: 3.3.2 @@ -837,12 +843,6 @@ packages: url: https://files.pythonhosted.org/packages/2e/7d/2259318c202f3d17f3fe6438149b3b9e706d1070fe3fcbb28049730bb25c/charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl sha256: ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b requires_python: '>=3.7.0' -- kind: pypi - name: charset-normalizer - version: 3.3.2 - url: https://files.pythonhosted.org/packages/b6/7c/8debebb4f90174074b827c63242c23851bdf00a532489fba57fef3416e40/charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl - sha256: 96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001 - requires_python: '>=3.7.0' - kind: pypi name: click version: 8.1.7 @@ -3910,6 +3910,12 @@ packages: license: MIT, BSD size: 31928 timestamp: 1608166099896 +- kind: pypi + name: markupsafe + version: 2.1.5 + url: https://files.pythonhosted.org/packages/3f/14/c3554d512d5f9100a95e737502f4a2323a1959f6d0d01e0d0997b35f7b10/MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl + sha256: 823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb + requires_python: '>=3.7' - kind: pypi name: markupsafe version: 2.1.5 @@ -3928,12 +3934,6 @@ packages: url: https://files.pythonhosted.org/packages/48/d6/e7cd795fc710292c3af3a06d80868ce4b02bfbbf370b7cee11d282815a2a/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl sha256: 3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4 requires_python: '>=3.7' -- kind: pypi - name: markupsafe - version: 2.1.5 - url: https://files.pythonhosted.org/packages/3f/14/c3554d512d5f9100a95e737502f4a2323a1959f6d0d01e0d0997b35f7b10/MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl - sha256: 823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb - requires_python: '>=3.7' - kind: conda name: matplotlib version: 3.8.4 @@ -5460,7 +5460,7 @@ packages: name: repror version: 0.0.1 path: . - sha256: 9d14cdbb2cac8115b71744a919e4fb9c61b55c60e3cd846f434beb7304eb1cd9 + sha256: 73e74f9a37b16286c8f24d30db43eec47fc29da0fa7f7e2c87c11781590012d1 requires_python: ~=3.10 editable: true - kind: pypi @@ -5476,6 +5476,12 @@ packages: - pysocks!=1.5.7,>=1.5.6 ; extra == 'socks' - chardet<6,>=3.0.2 ; extra == 'use_chardet_on_py3' requires_python: '>=3.8' +- kind: pypi + name: rpds-py + version: 0.18.1 + url: https://files.pythonhosted.org/packages/01/7d/8552e329973a198e5e150cc6be068f5cbae797a89e64c02bbd47bd397dee/rpds_py-0.18.1-cp312-none-win_amd64.whl + sha256: 720edcb916df872d80f80a1cc5ea9058300b97721efda8651efcd938a9c70a72 + requires_python: '>=3.8' - kind: pypi name: rpds-py version: 0.18.1 @@ -5494,12 +5500,6 @@ packages: url: https://files.pythonhosted.org/packages/03/04/a39fc930b1ab45943b7f3a8d990a3c731b37541d9eb58c5664374c2ce007/rpds_py-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl sha256: 3dd3cd86e1db5aadd334e011eba4e29d37a104b403e8ca24dcd6703c68ca55b3 requires_python: '>=3.8' -- kind: pypi - name: rpds-py - version: 0.18.1 - url: https://files.pythonhosted.org/packages/01/7d/8552e329973a198e5e150cc6be068f5cbae797a89e64c02bbd47bd397dee/rpds_py-0.18.1-cp312-none-win_amd64.whl - sha256: 720edcb916df872d80f80a1cc5ea9058300b97721efda8651efcd938a9c70a72 - requires_python: '>=3.8' - kind: conda name: sip version: 6.7.12 From 8296f03f4ed4d35315df0688735df35783aa7a72 Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:14:12 +0300 Subject: [PATCH 4/8] misc: fix path obj --- src/repror/rebuild_recipe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repror/rebuild_recipe.py b/src/repror/rebuild_recipe.py index f4fbdc5a..4b4fc821 100644 --- a/src/repror/rebuild_recipe.py +++ b/src/repror/rebuild_recipe.py @@ -23,7 +23,7 @@ def rebuild_packages( rebuild_infos[recipe_name] = None continue - rebuild_directory = rebuild_dir / f"{recipe_name}_rebuild" + rebuild_directory = Path(rebuild_dir) / f"{recipe_name}_rebuild" output_dir = rebuild_directory / "output" From ac5fbf7a96e07f76432760ee4ab24e5ec3da9a4f Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:24:01 +0300 Subject: [PATCH 5/8] misc: set langs --- .github/workflows/build-and-rebuild.yaml | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index d3ef5cbe..c0c34b14 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -58,18 +58,33 @@ jobs: # - name: Verify LANG for Initial Build # run: echo $LANG + - name: Set timezone to UTC + if: matrix.os == 'ubuntu-latest' + run: sudo timedatectl set-timezone UTC + + - name: Set timezone to GMT + if: matrix.os == 'macos-latest' + run: sudo systemsetup -settimezone GMT + + - name: Set LANG + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV + - name: Build recipes and track if hash is equal run: | pixi run build-recipe ${{ matrix.recipes }} - # - name: Set timezone to PST - # run: sudo timedatectl set-timezone America/Los_Angeles + - name: Set timezone to Los Angeles + if: matrix.os == 'ubuntu-latest' + run: sudo timedatectl set-timezone America/Los_Angeles - # - name: Set LANG - # run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV + - name: Set timezone to Los Angeles + if: matrix.os == 'macos-latest' + run: sudo systemsetup -settimezone America/Los_Angeles - # - name: Verify LANG for Initial Build - # run: echo $LANG + - name: Set LANG + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: echo "LANG=et_EE.UTF-8" >> $GITHUB_ENV - name: Rebuild recipes and track if hash is equal run: | From 7cff434bc7ab4959d39edad79c5c5bf1735c5dac Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:24:32 +0300 Subject: [PATCH 6/8] misc: set variatons --- .github/workflows/build-and-rebuild.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index c0c34b14..97e7f9a7 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -49,15 +49,6 @@ jobs: with: pixi-version: "latest" - # - name: Set timezone to UTC - # run: sudo timedatectl set-timezone UTC - - # - name: Set LANG - # run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - - # - name: Verify LANG for Initial Build - # run: echo $LANG - - name: Set timezone to UTC if: matrix.os == 'ubuntu-latest' run: sudo timedatectl set-timezone UTC From 497ac9e883ef2ab5667a342342318d037ae67e39 Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:25:05 +0300 Subject: [PATCH 7/8] misc: rewrite readme --- .github/workflows/build-and-rebuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index 97e7f9a7..6ffe4cf2 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -111,7 +111,7 @@ jobs: - name: Calculate statistics and plot output run: | - pixi run python src/repror/rewrite_readme.py + pixi run rewrite-readme - name: Commit and push changes env: From f21a833e5ab4ba8d339ad8d294446b390ab41001 Mon Sep 17 00:00:00 2001 From: nichmor Date: Mon, 3 Jun 2024 15:43:33 +0300 Subject: [PATCH 8/8] misc: typo recipe --- .github/workflows/build-and-rebuild.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-rebuild.yaml b/.github/workflows/build-and-rebuild.yaml index 6ffe4cf2..c14ee54a 100644 --- a/.github/workflows/build-and-rebuild.yaml +++ b/.github/workflows/build-and-rebuild.yaml @@ -15,7 +15,7 @@ jobs: generate-recipes: runs-on: ubuntu-latest outputs: - recipes: ${{ steps.generate-matrix.outputs.recipes }} + recipe: ${{ steps.generate-matrix.outputs.recipes }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -36,7 +36,7 @@ jobs: continue-on-error: true strategy: matrix: - recipes: ${{ fromJson(needs.generate-recipes.outputs.recipes) }} + recipe: ${{ fromJson(needs.generate-recipes.outputs.recipe) }} os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} @@ -63,7 +63,7 @@ jobs: - name: Build recipes and track if hash is equal run: | - pixi run build-recipe ${{ matrix.recipes }} + pixi run build-recipe ${{ matrix.recipe }} - name: Set timezone to Los Angeles if: matrix.os == 'ubuntu-latest' @@ -79,7 +79,7 @@ jobs: - name: Rebuild recipes and track if hash is equal run: | - pixi run rebuild-recipe ${{ matrix.recipes }} + pixi run rebuild-recipe ${{ matrix.recipe }} - name: Upload results uses: actions/upload-artifact@v3