{"id":43435837,"url":"https://github.com/mozilla-releng/mozilla-linux-pkg-manager","last_synced_at":"2026-02-02T20:53:19.716Z","repository":{"id":207467900,"uuid":"719270598","full_name":"mozilla-releng/mozilla-linux-pkg-manager","owner":"mozilla-releng","description":"mozilla-linux-pkg-manager is a tool for managing Linux packages stored GCP artifact registry.","archived":false,"fork":false,"pushed_at":"2025-12-15T20:29:03.000Z","size":271,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T04:26:30.297Z","etag":null,"topics":["artifact-registry","asyncio","cli","command-line-tool","google-cloud","package-management","python"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/mozillareleases/mozilla-linux-pkg-manager/tags","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozilla-releng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-15T20:20:43.000Z","updated_at":"2024-03-01T19:38:32.000Z","dependencies_parsed_at":"2023-12-11T21:26:05.744Z","dependency_job_id":"bbe2a911-aa88-4ceb-8688-673afc42152d","html_url":"https://github.com/mozilla-releng/mozilla-linux-pkg-manager","commit_stats":null,"previous_names":["mozilla-releng/mozilla-deb-pkg-manager","mozilla-releng/mozilla-gcp-ar-pkg-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mozilla-releng/mozilla-linux-pkg-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-releng%2Fmozilla-linux-pkg-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-releng%2Fmozilla-linux-pkg-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-releng%2Fmozilla-linux-pkg-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-releng%2Fmozilla-linux-pkg-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozilla-releng","download_url":"https://codeload.github.com/mozilla-releng/mozilla-linux-pkg-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla-releng%2Fmozilla-linux-pkg-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29019462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artifact-registry","asyncio","cli","command-line-tool","google-cloud","package-management","python"],"created_at":"2026-02-02T20:53:18.935Z","updated_at":"2026-02-02T20:53:19.708Z","avatar_url":"https://github.com/mozilla-releng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Task Status](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-linux-pkg-manager/main/badge.svg)](https://firefox-ci-tc.services.mozilla.com/api/github/v1/repository/mozilla-releng/mozilla-linux-pkg-manager/main/latest)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/mozilla-releng/mozilla-linux-pkg-manager/main.svg)](https://results.pre-commit.ci/latest/github/mozilla-releng/mozilla-linux-pkg-manager/main)\n[![Code Coverage](https://codecov.io/gh/mozilla-releng/mozilla-linux-pkg-manager/branch/main/graph/badge.svg?token=GJIV52ZQNP)](https://codecov.io/gh/mozilla-releng/mozilla-linux-pkg-manager)\n\n# mozilla-linux-pkg-manager\n\n`mozilla-releng/mozilla-linux-pkg-manager` is a Python tool for managing packages stored in Linux software repositories hosted on Google Cloud Platform.\n\n## Requirements\n- Python 3.11 or higher\n- uv (for dependency management)\n\n## Development\n\n### Installing `mozilla-linux-pkg-manager`\n1. **Install uv**: If not already installed, install uv by following the instructions from the [official uv website](https://docs.astral.sh/uv/).\n2. **Clone the Repository**: Clone the `mozilla-linux-pkg-manager` repository using the command `git clone https://github.com/mozilla-releng/mozilla-linux-pkg-manager.git`.\n3. **Install Dependencies**: Navigate to the repository's root directory and run `uv sync` to install the required dependencies.\n\n### Setup Authentication\nThe easiest way to authenticate is using the Google Cloud SDK:\n\n```bash\ngcloud auth application-default login\n```\nNote that this command generates credentials for the Google Cloud Platform client libraries.\n\n### Setup the Development Environment\nTo set up the environment for running `mozilla-linux-pkg-manager` set the following variables:\n\n```bash\n# defaults to /path/to/home/.config/gcloud/application_default_credentials.json\nexport GOOGLE_APPLICATION_CREDENTIALS=[/path/to/google/application/credentials/file.json]\nexport GOOGLE_CLOUD_PROJECT=[PROJECT_NAME]\n```\n\n### Running `mozilla-linux-pkg-manager`\nTo run `mozilla-linux-pkg-manager`, use uv with the following command:\n```bash\nuv run mozilla-linux-pkg-manager clean-up [-h] --package PACKAGE --repository REPOSITORY [REPOSITORY ...] --region REGION --retention-days RETENTION_DAYS [--dry-run]\n```\n\n#### Parameters\n- `--package`: A regular expression matching the name of the packages to clean-up.\n- `--retention-days`: Sets the retention period in days for packages that match the `package` regex.\n- `--dry-run`: Tells the script to do a no-op run and print out a summary of the operations that will be executed.\n- `--repository`: One or more repositories to perform maintenance operations on.\n- `--region`: The cloud region the repository is hosted in.\n\n#### Examples\nClean up firefox and firefox l10n packages that are older than 365 days:\n```bash\nmozilla-linux-pkg-manager \\\nclean-up \\\n--package \"^firefox(-l10n-.+)?$\" \\\n--retention-days 365 \\\n--repository mozilla \\\n--region us\n```\n\nClean up firefox-nightly and firefox-nightly l10n packages that are older than a day:\n```bash\nmozilla-linux-pkg-manager \\\nclean-up \\\n--package \"^firefox-nightly(-l10n-.+)?$\" \\\n--retention-days 1 \\\n--repository mozilla \\\n--region us\n```\n\nClean up firefox-devedition and firefox-devedition l10n packages that are older than 60 days:\n```bash\nmozilla-linux-pkg-manager \\\nclean-up \\\n--package \"^firefox-(devedition|beta)(-l10n-.+)?$\" \\\n--retention-days 60 \\\n--repository mozilla \\\n--region us\n```\n\n## Docker\n\nThe `mozilla-linux-pkg-manager` tool can also be run as a Docker container using the [mozillareleases/mozilla-linux-pkg-manager](https://hub.docker.com/r/mozillareleases/mozilla-linux-pkg-manager/tags) image.\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=[GOOGLE_CLOUD_PROJECT]\nexport GOOGLE_APPLICATION_CREDENTIALS=[/path/to/google/application/credentials/file.json]\ndocker run --rm \\\n-e GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT \\\n-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/google/key.json \\\n-v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/keys/google/key.json:ro \\\nmozillareleases/mozilla-linux-pkg-manager:0.7.0 \\\nclean-up \\\n--package \"^firefox(-l10n-.+)?$\" \\\n--retention-days 3 \\\n--repository [REPOSITORY] \\\n--region [REGION] \\\n--dry-run\n```\n\n### Building the Docker Image\n\nYou can build the Docker image locally with:\n\n```bash\ntaskgraph build-image pkg-manager\n```\n\nThis command builds a Docker image with the tag `pkg-manager:latest`.\n\n### Running the Docker Container\n\nTo run the `mozilla-linux-pkg-manager` in a Docker container, you need to set the Google Application Credentials and mount them as a volume in the container. Replace `[FILE_NAME].json` with the name of your Google Application Credentials file and ensure the path to the credentials file is correctly set in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.\n\n```bash\n# defaults to /path/to/home/.config/gcloud/application_default_credentials.json\nexport GOOGLE_APPLICATION_CREDENTIALS=[/path/to/google/application/credentials/file.json]\nexport GOOGLE_CLOUD_PROJECT=[PROJECT_NAME]\n\ndocker run \\\n-e GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT \\\n-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/google/key.json \\\n-v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/keys/google/key.json:ro \\\n$IMAGE_NAME \\\nclean-up \\\n--package \"^firefox(-l10n-.+)?$\" \\\n--retention-days 3 \\\n--repository mozilla \\\n--region us \\\n--dry-run\n```\n\nIn this command:\n- The `-e` flag sets the `GOOGLE_APPLICATION_CREDENTIALS` and `GOOGLE_CLOUD_PROJECT` environment variables inside the container.\n- The `-v` flag mounts the credentials file from your host system to the container.\n- The last line specifies the command and its arguments to be executed inside the container.\n\n## Building and Installing a Python Wheel\n\nThe `mozilla-linux-pkg-manager` package can be packaged into a wheel file for distribution and installation.\n\n### Building the Wheel\n1. **Navigate to the Project Directory**: Open your terminal and navigate to the directory where your project is located.\n2. **Build the Package**: Execute `uv tool run hatch build` to create the wheel file. This will generate a `dist` folder in your project directory containing the `.whl` file, whose name may vary based on the version and build.\n\n### Installing the Wheel File\n1. **Navigate to the `dist` Directory**: Move to the `dist` directory where the `.whl` file is located.\n2. **Install the Wheel File**: Use `pip install [wheel-file-name]` to install the package. Replace `[wheel-file-name]` with the actual name of the wheel file generated during the build process.\n\n### Using the Installed Package\nAfter installation, the package can be used from anywhere on your system, provided you are running the Python interpreter where it was installed.\n\n# Publish a new docker image\n\nAfter bumping the version and tagging it, find the `docker-image-pkg-manager` task for that commit, note it down as `TASK_ID`.\nYou can then do:\n\n```\ntaskgraph load-image --task-id=\u003cTASK_ID\u003e -t mozillareleases/mozilla-linux-pkg-manager:\u003cVERSION\u003e\ndocker push mozillareleases/mozilla-linux-pkg-manager:\u003cVERSION\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla-releng%2Fmozilla-linux-pkg-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozilla-releng%2Fmozilla-linux-pkg-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla-releng%2Fmozilla-linux-pkg-manager/lists"}