Skip to content

Commit

Permalink
Support mandatory attributes of VM Images
Browse files Browse the repository at this point in the history
Signed-off-by: Anja Strunk <anja.strunk@cloudandheat.com>
  • Loading branch information
anjastrunk committed Dec 19, 2023
1 parent eec2efe commit 5ea69c7
Show file tree
Hide file tree
Showing 7 changed files with 2,798 additions and 66 deletions.
25 changes: 20 additions & 5 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ vm image:
copyright owner: "The FreeBSD Project"
resource policy: DEFAULT
license:
- GPL-3.0
- GPL-3.0-only
- LGPL-2.0
Gentoo Linux:
copyright owner: "Gentoo Foundation, Inc."
Expand All @@ -39,17 +39,17 @@ vm image:
copyright owner: "Mandriva Linux"
resource policy: DEFAULT
license:
- GPL-3.0
- GPL-3.0-only
Mandriva Linux:
copyright owner: "Mandriva S. A."
resource policy: DEFAULT
license:
- GPL-3.0
- GPL-3.0-only
Mandriva Enterprise Server:
copyright owner: "Mandriva S. A."
resource policy: DEFAULT
license:
- GPL-3.0
- GPL-3.0-only
MS-DOS:
copyright owner: "Microsoft Corporation"
resource policy: DEFAULT
Expand Down Expand Up @@ -104,4 +104,19 @@ vm image:
copyright owner: "Microsoft Corporation"
resource policy: DEFAULT
license:
- https://www.microsoft.com/licensing
- https://www.microsoft.com/licensing
CirrOS:
copyright owner: "Canonical Ltd."
resource policy: DEFAULT
license:
- GPL-2.0-only
AlmaLinux:
copyright owner: "Canonical Ltd."
resource policy: DEFAULT
license:
- https://almalinux.org/p/the-almalinux-os-licensing-policy/
Debian 11:
copyright owner: "AlmaLinux OS Foundation"
resource policy: DEFAULT
license:
- https://www.abc.org
13 changes: 6 additions & 7 deletions generator/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import click
import openstack as os
import sys
import yaml

from generator.discovery.openstack.opentack_discovery import OsCloud

Expand All @@ -11,9 +12,10 @@ def cli():


@click.command()
@click.option('--config', default='../config/config.yaml', help='Path to Configuration file for SCS GX Credential Generator.')
@click.option('--timeout', default=12, help='Timeout for API calls in seconds')
@click.argument('cloud')
def openstack(cloud, timeout):
def openstack(cloud, timeout, config):
"""Generates Gaia-X Credentials for openstack cloud CLOUD.
CLOUD MUST refer to a name defined in Openstack's configuration file clouds.yaml."""

Expand All @@ -28,12 +30,9 @@ def openstack(cloud, timeout):
conn.authorize()

# generate Gaia-X Credentials
os_cloud = OsCloud(conn)
props = os_cloud.discover_properties()




with open(config, "r") as config_file:
os_cloud = OsCloud(conn, yaml.safe_load(config_file))
props = os_cloud.discover_properties()


@click.command()
Expand Down
34 changes: 32 additions & 2 deletions generator/common/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
DEFAULT_RESOURCE_POLICY = "default: allow intent"

UNIT_MB = "https://qudt.org/vocab:unit/MegaBYTE"
UNIT_GB = "https://qudt.org/vocab:unit/GigaBYTE"
UNIT_MB = "https://qudt.org/vocab/unit/MegaBYTE"
UNIT_GB = "https://qudt.org/vocab/unit/GigaBYTE"


CONFIG_VM_IMAGE = "vm image"
CONFIG_RESOURCE_POLICY = "resource policy"
CONFIG_LICENSE = "license"
CONFIG_COPYRIGHT = "copyright owner"

CONFIG_OS_ALP = "Alpine Linux"
CONFIG_OS_ARCH = "Arch Linux"
CONFIG_OS_CENTOS = "CentOS Linux"
CONFIG_OS_DEBIAN = "Debian"
CONFIG_OS_FEDORA = "Fedora"
CONFIG_OS_FREEBSD = "FreeBSD"
CONFIG_OS_GENTOO = "Gentoo Linux"
CONFIG_OS_MANDRAKE = "Mandrake Linux"
CONFIG_OS_MANDRIVA = "Mandriva Linux"
CONFIG_OS_MES = "Mandriva Enterprise Server"
CONFIG_OS_MSDOS = "MS-DOS"
CONFIG_OS_NETBSD = "NetBSD"
CONFIG_OS_NOVELL = "Novell Netware"
CONFIG_OS_OPENBSD = "OpenBSD"
CONFIG_OS_SOLARIS = "OpenSolaris"
CONFIG_OS_OPEN_SUSE = "openSUSE"
CONFIG_OS_ROCKY = "Rocky Linux"
CONFIG_OS_RHEL = "Red Hat Enterprise Linux"
CONFIG_OS_SLED = "SUSE Linux Enterprise Desktop"
CONFIG_OS_UBUNTU = "Ubuntu"
CONFIG_OS_WINDOWS = "Microsoft Windows"
CONFIG_OS_CIRROS = "CirrOS"
CONFIG_OS_ALMALINUX = "AlmaLinux"
2,275 changes: 2,275 additions & 0 deletions generator/common/gaia-x.shacl

Large diffs are not rendered by default.

Loading

0 comments on commit 5ea69c7

Please sign in to comment.