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

[WIP] warehouse: TUF initialization #7488

Closed
wants to merge 74 commits into from

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Mar 3, 2020

Adds CLI and task support for initializing a TUF repository.

Adds a service interface (IKeyService) with a filesystem-based
implementation (LocalKeyService). Deployment will require a (potentially cloud-based)
KMS implementation.

TOPLEVEL_ROLES = ["root", "snapshot", "targets", "timestamp"]


@task(bind=True, ignore_result=True, acks_late=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we ever be invoking this as a Celery task, or is this just being implemented to match other CLI commands that call tasks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter -- we shouldn't ever need to run this either manually or periodically after initial setup. I did it as a Celery task to get access to a request object; is there another way to do that just in the context of the CLI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, then I think you can use the warehouse.cli.warehouse.command decorator to receive a config object on your CLI entry point function instead. See the shell cli command for example.

@woodruffw woodruffw force-pushed the tob-tuf-repo-initialization branch from f617964 to 0b08b0c Compare April 1, 2020 14:48
@woodruffw woodruffw force-pushed the tob-tuf-repo-initialization branch from 0b08b0c to f8e7d67 Compare April 6, 2020 20:33
Base automatically changed from master to main January 21, 2021 18:39
@di di mentioned this pull request Feb 1, 2022
52 tasks
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Mar 4, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Mar 30, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Mar 31, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Apr 11, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request May 30, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Jun 25, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Aug 22, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Sep 20, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo pushed a commit to kairoaraujo/warehouse that referenced this pull request Sep 30, 2022
This work refactors the
[Draft PR](pypi#7488) by
@ woodruffw, to build a new repository tool on top of the Python-TUF
Metadata API, and use it instead of the Python-TUF repository tool
that was deprecated in v1.0.0.

Part of pypi#10672

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
kairoaraujo added a commit to kairoaraujo/warehouse that referenced this pull request Jan 25, 2024
The vault container was a previous TUF implementation
(TUF initialization pypi#7488)

The new integration with RSTUF does not require this container.

Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>
ewdurbin added a commit that referenced this pull request Jan 26, 2024
* remove vault container

The vault container was a previous TUF implementation
(TUF initialization #7488)

The new integration with RSTUF does not require this container.

Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>

* PEP 458: Add RSTUF services in the Warehouse Infra

This commit adds the RSTUF services to the Warehouse infrastructure
for development and sets the minimum required to start RSTUF services.

It adds the RSTUF API, which is used later to integrate into Warehouse
and RSTUF Worker, which is responsible for computing the TUF metadata.

The RSTUF requires the Postgres and Redis.
Postgres stores the rstuf database used for TUF metadata computing.
Redis stores the task message queue between RSTUF API and Worker, task
backend result, and live settings between RSTUF services.

RSTUF shares the same Postgres and Redis in development environment
but has a specific setup to use its own Postgres database and Redis
database ID.

Postgresql URI
`RSTUF_SQL_SERVER=postgresql://postgres@db:5432/rstuf`

Redis DB Broker and Result is id 1
`RSTUF_BROKER_SERVER=redis://redis/1`
`RSTUF_REDIS_SERVER_DB_RESULT=1`

Redis DB for TUF repository settings is 2
`RSTUF_REDIS_SERVER_DB_REPO_SETTINGS=2`

This commit also includes TUF database creation in the Makefile
during the `make initdb`.

Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>

* remove rstuf-worker unnecessary settings

Remove settings from rstuf-worker in docker-compose.yml

Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>

* remove vault volume from docker-compose

---------

Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>
Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
@miketheman
Copy link
Member

Now that RSTUF is part of the dev setup from #15241, is this PR still useful, or should it be closed?

@lukpueh
Copy link
Contributor

lukpueh commented Feb 5, 2024

This can be closed.

@lukpueh
Copy link
Contributor

lukpueh commented Feb 5, 2024

This can be closed.

It is superseded by
#10870
#13943
#15241

@woodruffw woodruffw closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants