ODCS Script changes to generate openh264 repos #9679

Merged
jnsamyak merged 3 commits from private-odcs-all-arches into master 2026-06-08 03:11:29 +00:00
2 changed files with 61 additions and 1 deletions

View file

@ -7,6 +7,17 @@
# Private compose from a tag using odcs
#
"""
Usage: python odcs-private-compose.py <token> <koji_tag>
This is used to generate private composes using ODCS.
This script is specifically used to generate openh264 repos.
The compsoe is stored in /srv/odcs/private/ dir on
odcs-backend-releng01.iad2.fedoraproject.org
"""
import argparse
from odcs.client.odcs import ODCS, AuthMech, ComposeSourceTag
@ -25,5 +36,6 @@ odcs = ODCS("https://odcs.fedoraproject.org",
source = ComposeSourceTag(tag)
# Making a private compose with no inheritance
compose = odcs.request_compose(source, target_dir="private", flags=["no_inheritance"])
arches = ["armv7hl", "i686", "x86_64", "aarch64", "ppc64le", "s390x"]
compose = odcs.request_compose(source, target_dir="private", arches = arches, flags=["no_inheritance"])
print(compose)

48
scripts/odcs/odcs-token.py Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-2.0
# Author: Mohan Boddu <mboddu@bhujji.com>
#
# Private compose from a tag using odcs
#
"""
Usage: python odcs-token.py
This is used to generate a token needed to run odcs composes
"""
import openidc_client
staging = False
if staging:
id_provider = 'https://id.stg.fedoraproject.org/openidc/'
else:
id_provider = 'https://id.fedoraproject.org/openidc/'
# Get the auth token using the OpenID client.
oidc = openidc_client.OpenIDCClient(
'odcs',
id_provider,
{'Token': 'Token', 'Authorization': 'Authorization'},
'odcs-authorizer',
'notsecret',
)
scopes = [
'openid',
'https://id.fedoraproject.org/scope/groups',
'https://pagure.io/odcs/new-compose',
'https://pagure.io/odcs/renew-compose',
'https://pagure.io/odcs/delete-compose',
]
try:
token = oidc.get_token(scopes, new_token=True)
token = oidc.report_token_issue()
print(token)
except requests.exceptions.HTTPError as e:
print(e.response.text)
raise