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

Generate GX conformant credentials for VM Images #69

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
ca67aa4
Add auto-generated pyhton classes for GX Credential Schema
anjastrunk Nov 16, 2023
0ddef71
Update python classes
anjastrunk Nov 16, 2023
ddefa2d
Add CLI interface for openstack and kubernetes
anjastrunk Nov 16, 2023
3d4a6e1
Build framework
anjastrunk Nov 16, 2023
5fb3a51
Update vm image generations
anjastrunk Nov 17, 2023
96c5aee
Add default values for operating system
anjastrunk Dec 18, 2023
abf552c
Support mandatory attributes of VM Images
anjastrunk Dec 19, 2023
4a03ca8
Discover mandatory attributes
anjastrunk Dec 19, 2023
948887b
Support additional attributes
anjastrunk Dec 20, 2023
bb93b2f
Support additional attributes
anjastrunk Dec 21, 2023
6c40238
Restore gax-cpu.py
anjastrunk Dec 22, 2023
f4c021b
Restore gax-cpu.py
anjastrunk Dec 22, 2023
002dcb5
Restore gax-cpu.py
anjastrunk Dec 22, 2023
d7acc4d
Remove unused files
anjastrunk Dec 22, 2023
3cf1f16
Add JSON-LD serialization
anjastrunk Jan 3, 2024
214cd30
Workaround for unions of data types
anjastrunk Jan 4, 2024
133a5f8
Support siganure, finish JSON-LD serialization, refactoring
anjastrunk Jan 5, 2024
23d5455
Support aggregation of
anjastrunk Jan 8, 2024
8239654
Support aggregationOf and hypervisorType
anjastrunk Jan 10, 2024
3b8e28a
Add first test case
anjastrunk Jan 15, 2024
5676a2c
Add unit tests
anjastrunk Jan 16, 2024
e9e12ed
Add shacl validation
anjastrunk Jan 16, 2024
fbc91e8
Add simple FileSystem Wallet
anjastrunk Jan 16, 2024
159e68f
Create python-app.yml
anjastrunk Jan 16, 2024
c3f3498
Reformat files
anjastrunk Jan 16, 2024
3ee8ed5
Merge branch 'anjastrunk-patch-1' into 67-make-generation-of-vm-image…
anjastrunk Jan 16, 2024
eebdb93
Update python-app.yml
anjastrunk Jan 16, 2024
2af9012
Fix tests
anjastrunk Jan 16, 2024
c9501f5
Merge branch '67-make-generation-of-vm-image-credentuial-gaia-x-compl…
anjastrunk Jan 16, 2024
a60e554
Fix unit tests
anjastrunk Jan 17, 2024
40957d1
Update python-app.yml
anjastrunk Jan 17, 2024
57a0daa
Update requirements
anjastrunk Jan 17, 2024
5ed6c00
Merge branch '67-make-generation-of-vm-image-credentuial-gaia-x-compl…
anjastrunk Jan 17, 2024
7304d34
Update documentation
anjastrunk Jan 17, 2024
4302c03
Refactoring
anjastrunk Feb 29, 2024
166b2bd
Add concept to integrate scs gaia-x generator into Federation Service…
anjastrunk Sep 28, 2023
85c4ff9
Update README.md with missing content (#57)
anjastrunk Oct 16, 2023
64df5fc
Replace self-description with credential (#65)
anjastrunk Oct 20, 2023
35dcfa5
Add auto-generated pyhton classes for GX Credential Schema
anjastrunk Nov 16, 2023
d3b9bdb
Update python classes
anjastrunk Nov 16, 2023
8d4d105
Add CLI interface for openstack and kubernetes
anjastrunk Nov 16, 2023
22e1202
Build framework
anjastrunk Nov 16, 2023
199a9aa
Update vm image generations
anjastrunk Nov 17, 2023
12dc8c5
Add default values for operating system
anjastrunk Dec 18, 2023
46c4e88
Support mandatory attributes of VM Images
anjastrunk Dec 19, 2023
790a147
Discover mandatory attributes
anjastrunk Dec 19, 2023
b45ae13
Support additional attributes
anjastrunk Dec 20, 2023
424dd61
Support additional attributes
anjastrunk Dec 21, 2023
901ebc9
Restore gax-cpu.py
anjastrunk Dec 22, 2023
1df49be
Restore gax-cpu.py
anjastrunk Dec 22, 2023
c9ce6ad
Restore gax-cpu.py
anjastrunk Dec 22, 2023
bb6446e
Remove unused files
anjastrunk Dec 22, 2023
0f1646a
Add JSON-LD serialization
anjastrunk Jan 3, 2024
287123e
Workaround for unions of data types
anjastrunk Jan 4, 2024
0d31f24
Support siganure, finish JSON-LD serialization, refactoring
anjastrunk Jan 5, 2024
c1dfd8b
Support aggregation of
anjastrunk Jan 8, 2024
08a2b8e
Support aggregationOf and hypervisorType
anjastrunk Jan 10, 2024
8768e85
Add first test case
anjastrunk Jan 15, 2024
e3d3333
Add unit tests
anjastrunk Jan 16, 2024
b7bba55
Add shacl validation
anjastrunk Jan 16, 2024
65667be
Add simple FileSystem Wallet
anjastrunk Jan 16, 2024
93e6a6b
Reformat files
anjastrunk Jan 16, 2024
5b1074f
Create python-app.yml
anjastrunk Jan 16, 2024
67c8fc6
Fix tests
anjastrunk Jan 16, 2024
98878f2
Update python-app.yml
anjastrunk Jan 16, 2024
1e42b6c
Fix unit tests
anjastrunk Jan 17, 2024
cc02b9a
Update requirements
anjastrunk Jan 17, 2024
97374bc
Update python-app.yml
anjastrunk Jan 17, 2024
866dd1b
Update documentation
anjastrunk Jan 17, 2024
ec33411
Refactoring
anjastrunk Feb 29, 2024
2cf6f61
Merge branch '67-make-generation-of-vm-image-credentuial-gaia-x-compl…
anjastrunk Feb 29, 2024
74c18fe
Rename CPU attrs according to Gaia-X specs.
garloff Jun 20, 2022
e5580f7
Move Gaia-X CPU class out to separate file.
garloff Jun 20, 2022
af0c40f
Store flavor data in approrpiate data structure.
garloff Jun 20, 2022
e075948
Move discovery to initiatlization (c'tor).
garloff Jun 20, 2022
85fa814
Option to output --gaia-x/--json.
garloff Jun 21, 2022
977c0d1
We now generate an SD that passed compliance svc.
garloff Jun 21, 2022
62bb4ce
Download and hash terms.pdf. ID with version.
garloff Jun 21, 2022
2924fdd
Update README file with 2022-06-21 status.
garloff Jun 22, 2022
2fa18a4
Add auth_url, versions/microversions and extensions.
garloff Jun 23, 2022
d31ca50
Report compute availability zones.
garloff Jun 24, 2022
5e1a3fc
Output all services from service catalog.
garloff Jun 24, 2022
d62a5dc
Updat README
garloff Jun 24, 2022
02c57b8
More updates to README.
garloff Jun 24, 2022
605bbf2
Add note on for the generator.
garloff Jun 24, 2022
0d4e089
Handle missing endpoints.
garloff Jun 24, 2022
06c49f2
Handle case where project_id is not explicitly set.
garloff Jun 28, 2022
f17f996
Handle multi-region catalogs. Handle conn errors.
garloff Jun 28, 2022
aaddb2d
Use SHA256 for hasing T&C doc. (#28)
garloff Dec 1, 2022
721ccda
We had declared compute as being handled. (#29)
garloff Dec 1, 2022
3b75a47
Feat/formatting (#30)
garloff Jan 30, 2023
3420219
Split Gaia-X SD driver (header, ...) from discovery. (#31)
garloff May 2, 2023
482c269
Add Gaia-X SD schema from @anjastrunk as reference. (#32)
garloff May 2, 2023
7d9dc0a
Timestamp should be an integer. (#33)
garloff May 2, 2023
9c3874e
Add Quick Start Guide and project's base requirements (#34)
matofeder May 3, 2023
192f675
Fix running without os-cloud. Make time an int. (#38)
garloff May 3, 2023
24012bc
Add simple SD validator script with some basic examples (#39)
matofeder May 3, 2023
a5e8274
Add a minimal GX service offering SD and the latest GX shapes (#40)
matofeder May 4, 2023
a76232f
Update shebang (#41)
maystery May 4, 2023
c43c276
first prototype with gaiax pipeline (#42)
gorkazar7 May 4, 2023
1ec9978
Added timestamp and file extension to the file name when output is fi…
juanarmentia May 4, 2023
1292ebd
Feature/generator output (#44)
juanarmentia May 4, 2023
23c4a80
Modify SD generation, so it is compliant with latest gaia-x shapes (#45)
chess-knight May 4, 2023
769d873
Adds K8s functionality for self-description generation (#47)
rminon May 4, 2023
b888793
feat: Add Dockerfile and basic description (#46)
maystery May 4, 2023
3d80024
Add prefix 'ex:' to the OpenStackService dict (#48)
chess-knight May 4, 2023
6041a80
fix py env (#50)
maxwolfs May 5, 2023
d74dbdf
Cleanup: No need for double default setting. (#49)
garloff May 5, 2023
118d9e8
Add option to generate SD working with Gaia-X Wizard (#51)
chess-knight May 12, 2023
d8c8a08
Feat/os lb provider (#52)
garloff May 19, 2023
a63ad90
Add concept to integrate scs gaia-x generator into Federation Service…
anjastrunk Sep 28, 2023
6fc0480
Update README.md with missing content (#57)
anjastrunk Oct 16, 2023
3049abc
Replace self-description with credential (#65)
anjastrunk Oct 20, 2023
4ddb70b
Add auto-generated pyhton classes for GX Credential Schema
anjastrunk Nov 16, 2023
26eb9fd
Update python classes
anjastrunk Nov 16, 2023
1105d4a
Add CLI interface for openstack and kubernetes
anjastrunk Nov 16, 2023
9c0a242
Build framework
anjastrunk Nov 16, 2023
710fd7c
Update vm image generations
anjastrunk Nov 17, 2023
cfea383
Add default values for operating system
anjastrunk Dec 18, 2023
ee1e31e
Support mandatory attributes of VM Images
anjastrunk Dec 19, 2023
dd5777a
Discover mandatory attributes
anjastrunk Dec 19, 2023
75e552f
Support additional attributes
anjastrunk Dec 20, 2023
f7bd497
Support additional attributes
anjastrunk Dec 21, 2023
e036d9b
Restore gax-cpu.py
anjastrunk Dec 22, 2023
44ef983
Restore gax-cpu.py
anjastrunk Dec 22, 2023
e8694ea
Restore gax-cpu.py
anjastrunk Dec 22, 2023
43b2135
Remove unused files
anjastrunk Dec 22, 2023
3789065
Add JSON-LD serialization
anjastrunk Jan 3, 2024
651f8e5
Workaround for unions of data types
anjastrunk Jan 4, 2024
c842b9c
Support siganure, finish JSON-LD serialization, refactoring
anjastrunk Jan 5, 2024
6f78145
Support aggregation of
anjastrunk Jan 8, 2024
78ed371
Support aggregationOf and hypervisorType
anjastrunk Jan 10, 2024
34b77bd
Add first test case
anjastrunk Jan 15, 2024
b9614ea
Add unit tests
anjastrunk Jan 16, 2024
4a8305e
Add shacl validation
anjastrunk Jan 16, 2024
c30fce1
Add simple FileSystem Wallet
anjastrunk Jan 16, 2024
fe6d1b5
Reformat files
anjastrunk Jan 16, 2024
1661f61
Create python-app.yml
anjastrunk Jan 16, 2024
65eee59
Fix tests
anjastrunk Jan 16, 2024
1f59514
Update python-app.yml
anjastrunk Jan 16, 2024
092069c
Fix unit tests
anjastrunk Jan 17, 2024
ffe3414
Update requirements
anjastrunk Jan 17, 2024
d7a3de0
Update python-app.yml
anjastrunk Jan 17, 2024
ab6f615
Update documentation
anjastrunk Jan 17, 2024
8bfdf04
Refactoring
anjastrunk Feb 29, 2024
dce208d
Update README.md with missing content (#57)
anjastrunk Oct 16, 2023
9537b43
Replace self-description with credential (#65)
anjastrunk Oct 20, 2023
03c4a2a
Add auto-generated pyhton classes for GX Credential Schema
anjastrunk Nov 16, 2023
48682c0
Update python classes
anjastrunk Nov 16, 2023
57bf98f
Add CLI interface for openstack and kubernetes
anjastrunk Nov 16, 2023
af3bee0
Build framework
anjastrunk Nov 16, 2023
c9ec405
Update vm image generations
anjastrunk Nov 17, 2023
ab8512c
Add default values for operating system
anjastrunk Dec 18, 2023
5d9a876
Support mandatory attributes of VM Images
anjastrunk Dec 19, 2023
0d0071a
Discover mandatory attributes
anjastrunk Dec 19, 2023
afadbd3
Support additional attributes
anjastrunk Dec 20, 2023
d98a165
Support additional attributes
anjastrunk Dec 21, 2023
8b4c660
Restore gax-cpu.py
anjastrunk Dec 22, 2023
df3ab56
Restore gax-cpu.py
anjastrunk Dec 22, 2023
2edbd1f
Restore gax-cpu.py
anjastrunk Dec 22, 2023
c42d7c0
Remove unused files
anjastrunk Dec 22, 2023
b334323
Add JSON-LD serialization
anjastrunk Jan 3, 2024
74d4a24
Workaround for unions of data types
anjastrunk Jan 4, 2024
cddc66b
Support siganure, finish JSON-LD serialization, refactoring
anjastrunk Jan 5, 2024
b66dd30
Support aggregation of
anjastrunk Jan 8, 2024
10e0c27
Support aggregationOf and hypervisorType
anjastrunk Jan 10, 2024
efbbe90
Add first test case
anjastrunk Jan 15, 2024
024d681
Add unit tests
anjastrunk Jan 16, 2024
6918ccd
Add shacl validation
anjastrunk Jan 16, 2024
8afd6f0
Add simple FileSystem Wallet
anjastrunk Jan 16, 2024
ff46629
Reformat files
anjastrunk Jan 16, 2024
55e8c37
Create python-app.yml
anjastrunk Jan 16, 2024
c56ffb3
Fix tests
anjastrunk Jan 16, 2024
1f75802
Fix unit tests
anjastrunk Jan 17, 2024
ad43a4b
Update python-app.yml
anjastrunk Jan 17, 2024
192f381
Update documentation
anjastrunk Jan 17, 2024
1dd8e24
Refactoring
anjastrunk Feb 29, 2024
b9f0d54
sign-off commits
anjastrunk Feb 29, 2024
a71744a
Sign-off commits
anjastrunk Feb 29, 2024
788b15f
Merge branch '67-make-generation-of-vm-image-credentuial-gaia-x-compl…
anjastrunk Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# pip install flake8 pytest
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
ls
python -m pytest tests/
191 changes: 122 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,131 +1,177 @@
# gx-credential-generator
Tools for creating [Gaia-X Crecential](https://gitlab.com/gaia-x/technical-committee/architecture-document/-/blob/master/architecture_document/gx_conceptual_model.md#gaia-x-credentials), formally knwon as Self-Descriptions for SCS compliant cloud infrastructures (OpenStack, k8s, ...)
Tool for creating [Gaia-X Crecentials](https://gitlab.com/gaia-x/technical-committee/architecture-document/-/blob/master/architecture_document/gx_conceptual_model.md#gaia-x-credentials), previously known as Gaia-X Self-Descriptions, for SCS compliant cloud infrastructures (OpenStack, k8s, ...)

## OpenStack
## Introduction

### OpenStack
We want to collect discoverable information from an OpenStack cloud,
assuming that we have access to it (as normal tenant user).

We start with the region list and then read the OpenStack catalog to collect
- OS_AUTH_URL (Keystone Endpoint)
- List of services (along with supported versions, min thr. max)
- Per service: extensions (cinderv3, nova)
- Flavors for compute incl. flavor details (SCS spec)
- AZs (for nova, cinderv3, neutron)
- UI (URL, type: horizon or custom)

This then should be output as JSON-LD (or YAML-LD) for the Gaia-X catalogue.

References:
- <https://gaia-x.gitlab.io/gaia-x-community/gaia-x-self-descriptions/service/service.html>
- <https://gitlab.com/gaia-x/gaia-x-community/gx-hackathon/gx-hackathon-3/-/blob/main/gxfs-track/self-descriptions/service_taxonomy.md>
- <https://gitlab.com/gaia-x/gaia-x-community/gx-hackathon/gx-hackathon-3/-/blob/main/gxfs-track/self-descriptions/sd_attributes.md>
- <https://github.com/SovereignCloudStack/Docs/blob/main/Design-Docs/flavor-naming.md>
- <https://github.com/garloff/openstack-api-discovery>

Notes from reviewing the SD attributes:
* Virtualized CPU types: It might be of limited use to reference exact model names, rather characterize properties
(generation, speed, insn set extensions, ...)
* NICs: Virtual NICs are almost unlimited, but there may be a limited amount of hardware-accelerated
NICs (using SR-IOV and multiqueue features) available -- these may need to be added to SCS flavor
naming.
* Other extension hardware like FPGAs need to be specified
* Tenant isolation needs a list of criteria. Virt OK? V(x)LANs OK? Shared storage cluster OK? ...
* Availability Zones: Provider needs to create transparency over what it means. Fire protection zones?
Power supply zones? Internet connectivity zones? Minimal and maximal physical distance? Network
latency distance?


## k8s
Same thing for k8s
We read the OpenStack catalog to collect
- public VM Images

This then should be output as GX compliant credential in JSON-LD for the Gaia-X catalogue.

### k8s
We want to collect discoverable information from a k8s cloud,
assuming that we have access to it.

Collect information on a k8s cluster:
- Metadata
- API Version
- Nodes information
- Pods information

## K8s as-a-Service (KaaS) offering considerations
#### K8s as-a-Service (KaaS) offering considerations

For typical k8s aaS offerings, every cluster is different,
and we probably don't want to have a description for every single
customer specific cluster. (Some providers may offer self-service,
so we would not want to push of a new SD into the G-X catalogue on
so we would not want to push of a new GX Credential into the GX catalogue on
creation, changing or deletion of clusters.) Still it might be
helpful to have a SD on demand for an existing cluster to characterize
it, so users can use the SD to match it to app requirements.
helpful to have a GX Credential on demand for an existing cluster to characterize
it, so users can use the GX Credentials to match it to app requirements.

So the SD for a k8s aaS solution would list possible options and
So the GX Credential for a k8s aaS solution would list possible options and
ranges: What k8s versions are supported, what max number of workers,
flavors, etc.? What services are optionally delivered (and supported)
by the provider?

For KaaS, the option space really needs to be described.
As of now, this can not be discovered, short of using external sources,
like the IaaS SD, the list of node images (osism minio), ...
like the IaaS GX Credential, the list of node images (osism minio), ...


## Quick Start Guide

1. Clone the repository into a location of your choice
```bash
git clone git@github.com:SovereignCloudStack/gx-self-description-generator.git
cd gx-self-description-generator
git clone git@github.com:SovereignCloudStack/gx-credential-generator.git
cd gx-credential-generator
```

2. Install scripts dependencies (installing them into a Python [virtualenv](https://virtualenv.pypa.io/en/stable/) is recommended)
```bash
pip install -r requirements.txt
```

3. Create `clouds.yaml` configuration file
- Gaia-x generator has to be configured with user credentials, auth-url, ... to access your Openstack cloud. This is done using [clouds.yaml](https://docs.openstack.org/python-openstackclient/ussuri/configuration/index.html)
- Make sure the following keys exist in our `clouds.yaml`

### OpenStack

a. Create `clouds.yaml` configuration file
- GX credential Generator requires access to OpenStack cluster as normal tenant user and has to be configured with these user credentials to access your Openstack cloud. This is done using [clouds.yaml](https://docs.openstack.org/python-openstackclient/ussuri/configuration/index.html). clouds.yaml is a yaml file containing several cloud configurations. Each configuration is referred by name.
- Make sure the following keys exist in our `clouds.yaml`.
- `auth.user_domain_name`
- `auth.project_domain_name`
- `region_name`

4. Generate Gaia-X Credentials

b. Generate Gaia-X Credentials

- OpenStack to json file (timestamp and extension is added to file name and script assumes OpenStack access (as normal tenant user)
```bash
./gx-sd-generator.py --gaia-x --os-cloud=<os-cloud> --file=<file-name>
- To print OpenStack properties in JSON-LD
```bash
python3 cli.py openstack <os-cloud>
```
- To use generated Gaia-X Credential in [Gaia-X Wizard](https://wizard.lab.gaia-x.eu/) add `--wizard` option
- '@' has to be removed from @id and @type in generated SD, to be able to sign and verify it in Gaia-X Wizard
- K8s (script assumes K8s access)
[//]: <> (- To store OpenStack properties as several credentials in wallet
```bash
python3 cli.py openstack <os-cloud> --wallet
```)

[//]: <> (- To omit to print OpenStack properties on screen and to store OpenStack properties as credential in wallet
```bash
python3 cli.py openstack <os-cloud> --wallet --no-print
```)

### K88
Generate Gaia-X Credentials
- To print K8s properties ...
```bash
./gx-sd-generator.py k8s
```

4. Start the gaiax-pipeline
### Airflow Pipeline
Start the gaiax-pipeline (deprecated)
- To modify the airflow pipeline you have to touch the gaiax-pipeline.py file inside the dags folder
```
cd devops
docker-compose up -d
```
```
cd devops
docker-compose up -d
```

## Simple SelfDescription validator
### Validation

Generated SelfDescriptions could be validated against their schemas (shapes) by the
Generated GX Credentials could be validated against their schemas (shapes) by the
simple SD validator script. Visit the `sd` directory and try to validate your
generated SD. Find the examples in `sd` directory and do the validation as follows:
```bash
./sd/validate.py sd/example.jsonld sd/example.ttl
```

### GX SelfDescription - Service Offering minimal example

SD definition `sd/gx_service_offering_example.jsonld` should represent
a minimal GX Service Offering example that is valid against the latest GX shacl shapes `sd/gx_shapes_latest.ttl`.
The latest GX shacl shapes (at the time of Hackathon#6 23/05/3-4) are
used by the [GX wizard](https://wizard.lab.gaia-x.eu/), and they have been downloaded from the [GX registry](https://registry.lab.gaia-x.eu/v1/api/trusted-shape-registry/v1/shapes/trustframework).

Try to validate a minimal example against the latest GX shapes (feel free to remove some
required attribute and check validation result):
```bash
./sd/validate.py sd/gx_service_offering_example.jsonld sd/gx_shapes_latest.ttl
```


## Compliance

GX Credential Generator creates credentials compliant with the latest (3024/01/19) Credential Schema, which can be downloaded from the [GX registry](https://registry.lab.gaia-x.eu/v1/api/trusted-shape-registry/v1/shapes/trustframework).
GX Credential Generator **does not** create W3C complaint [Verifiable Credentials](https://www.w3.org/TR/vc-data-model/).

## Configuration

GX Credential generator is configured by `config.yaml`. The configuration includes:

- Mandatory: Default values for mandatory attributes
- Optional: Values for optional attributes
- Optional: Wallets

### Mandatory Attributes
Gaia-X Credential schema dictates mandatory attributes for some class. If values for mandatory attributes can not be access from OpenStack or K8S cluster, default values are taken from configuration file in section `default`.
Providers are able to change default values. In doing so, attribute values for **ALL** instances of impacted cloud resource are modified.

#### CopyrightOwner, License and ResourcePolicy of VM images

`copyrigthowner`, `license` and `resourcePolicy` are mandatory attributes for VM Images and their operating systems. As these values are not accessible from OpenStack cloud, default values are used. The values for operating system are defined in section `operating system` with one section for each operating system. Operating systems are refered by name, e.g. for Alpine Linux.

```yaml
default:
operating system:
Alpine Linux:
copyright owner: "Alpine Linux"
resource policy: "default: allow intent"
license:
- https://gitlab.alpinelinux.org/alpine/aports/-/issues/9074
```

By default, generator uses operating system values for VM Image as well. I.e. by default, VM Image and operating system have the same values for `copyrigthOwner`, `license` and `resourcePolicy`. Providers are able to change values for each VM image, individually. Therefore, the section `own images` in `cloud resources` exists. To set individual values for a specific VM image, add a new section, started by image's name (as defined in OpenStack cloud) to configuration file. The following example defines ìndividual values for `copyrigthOwner`, `license` and `resourcePolicy` for VM image called `AlmaLinux 8`.

```yaml
cloud resources:
own images:
AlmaLinux 8:
copyright owner:
- "AlmaLinux OS Foundation"
- "ABC"
resource policy: "abc"
license:
- https://www.abc.org
```

### Optional Attributes

Similar to mandatory attributes, GX Credential Schemas supports optional attributes, whose values can not be retrieved from OpenStack cloud. These values can be set in configuration file in section `cloud resources` as well.

#### AggregationOf of VM Images

GX Credential schema allows to describe cloud resources, such VM images, in a fine granular manner, by using attribute `aggregationOf`. This attribute refers a list of GX credentials either as [DID](https://www.w3.org/TR/did-core/) or as file path relative to generators working directory. The latter is copied to cloud resource's credentials. For more details on GX credential schema and its attributes, please refer [Gaia-X Service Characteristics GitLab](https://gitlab.com/gaia-x/technical-committee/service-characteristics)

[//]: <> (### Wallets)
[//]: <> (Wallets are digital secure storages to store Verifiable Credentials, like GX credentials. GX generator stores generated GX credentials in all configured wallets. Wallets are configured in section `wallets`. The following wallets are supported:)

[//]: <> (- File System:
- Stores credentials on dedicated folder in disk. Use this wallet for testing purpose only.
)


## Docker

The docker environment creates a general and portable environment for the gx-sd-generator module. Before running the container, don't forget to mount your credentials for the correct path. OpenStack-related secret located under `~/.config/openstack`
Expand All @@ -149,6 +195,14 @@ mkdir -p os_secret && cp secret1 /os_secret
docker run -v "${PWD}/os_secret:/root/.config/openstack" $(docker build -q .) ./gx-sd-generator.py --os-cloud gx-h61.1
```

Generated SelfDescriptions could be validated against their schemas (shapes) by the

simple SD validator script. Visit the `sd` directory and try to validate your
generated SD. Find the examples in `sd` directory and do the validation as follows:
```bash
./sd/validate.py sd/example.jsonld sd/example.ttl
```

## Status (2023-05-04)
The current PoC code can discover OpenStack capabilities and produces
an entry for the services in the service catalogue, with name,
Expand All @@ -167,7 +221,6 @@ https://signer.demo.delta-dao.com/#signer

From an OpenStack perspective, this still incomplete.
- We lack flavor details (though we need SCS specs to discover more)
- We lack a list of public images (along with image details)
- Neutron probably has a few things to detect.

During Hackathon#6, the JSON-LD was updated match the current
Expand Down
Loading
Loading