Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed Sep 9, 2024
1 parent ff7457e commit 353d3e5
Show file tree
Hide file tree
Showing 40 changed files with 721 additions and 724 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cloud-info.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 'Deploy cloud-info'
name: "Deploy cloud-info"

on:
push:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy-image-sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 'Deploy image sync'
name: "Deploy image sync"

on:
push:
Expand All @@ -16,4 +16,3 @@ jobs:
dir: "deploy/image-sync"
tags: "docker,image-sync"
secrets: inherit

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
terraform:
name: 'Terraform'
name: "Terraform"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.9'
python-version: ">=3.9"
- name: Install dependencies
run: |
pip install molecule molecule-plugins[docker] pytest pytest-testinfra
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Test cloud-info-generator
run: |
cd cloud-info
pip install -r requirements.txt
pip install .
cd cloud_info_catchall
python3 -m unittest
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Test cloud-info-generator
run: |
cd cloud-info
pip install -r requirements.txt
pip install .
cd cloud_info_catchall
python3 -m unittest
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Before proposing a contribution via pull request, ideally there is an open
issue describing the need for your contribution (refer to this issue number
when you submit the pull request). We have a 3 steps process for contributions.

1. Fork the project if you have not, and commit changes to a git branch
1. Fork the project if you have not, and commit changes to a Git branch
1. Create a GitHub Pull Request for your change, following the instructions
in the pull request template.
1. Perform a [Code Review](#code-review-process) with the maintainers on the
Expand Down Expand Up @@ -51,7 +51,7 @@ follows:
1. If a maintainer has feedback or questions on your changes then they will set
`request changes` in the review and provide an explanation.

## Using git
## Using Git

For collaboration purposes, it is best if you create a GitHub account and fork
the repository to your own account. Once you do this you will be able to push
Expand All @@ -60,7 +60,7 @@ be easier to send pull requests.

### Branches and Commits

You should submit your patch as a git branch named after the GitHub issue, such
You should submit your patch as a Git branch named after the GitHub issue, such
as `#3`\. This is called a _topic branch_ and allows users to associate a
branch of code with the issue.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ generated in this repository.
## Deployment
Deployment is managed with GitHub actions, there is a VM for the
Deployment is managed with GitHub Actions, there is a VM for the
cloud-info-provider and one VM for the image sync. Check the [deploy](./deploy)
directory for details. Configuration is done with ansible using a
[dedicated role](./deploy/roles/catchall):
Expand Down
12 changes: 6 additions & 6 deletions caso/voms.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"ops": {
"projects": ["ops"]
},
"fedcloud.egi.eu": {
"projects": ["foo", "bar"]
}
"ops": {
"projects": ["ops"]
},
"fedcloud.egi.eu": {
"projects": ["foo", "bar"]
}
}
60 changes: 30 additions & 30 deletions cloud-info/openstack.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
site:
name: SITE-NAME
name: SITE-NAME

compute:
# Configure here the VOs supported at your installation
shares:
# Name of the VO
ops:
# Authentication for the VO into OpenStack
auth:
# the project id in OpenStack
project_id: xxxxx
# Default network type: none, public, public_only, private, private_only
default_network_type: public
# Public Network name
public_network_name: PUBLIC
# Configure here the VOs supported at your installation
shares:
# Name of the VO
ops:
# Authentication for the VO into OpenStack
auth:
# the project id in OpenStack
project_id: xxxxx
# Default network type: none, public, public_only, private, private_only
default_network_type: public
# Public Network name
public_network_name: PUBLIC

# A second VO
# fedcloud.egi.eu:
# auth:
# project_id: xxxx
# # Default network type: none, public, public_only, private, private_only
# default_network_type: public
# # Public Network name
# public_network_name: PUBLIC
# A second VO
# fedcloud.egi.eu:
# auth:
# project_id: xxxx
# # Default network type: none, public, public_only, private, private_only
# default_network_type: public
# # Public Network name
# public_network_name: PUBLIC

# Add as many VOs as needed
# Add as many VOs as needed

# Total number of cores available
total_cores: 0
# Total RAM available (GB)
total_ram: 0
# Hypervisor name
hypervisor: Foo Hypervisor
# Hypervisor version
hypervisor_version: 0.0.0
# Total number of cores available
total_cores: 0
# Total RAM available (GB)
total_ram: 0
# Hypervisor name
hypervisor: Foo Hypervisor
# Hypervisor version
hypervisor_version: 0.0.0
3 changes: 2 additions & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ Deployment is performed in 2 phases:
1. Terraforming the VM where the cloud-info-provider is run
1. Configuring the VM with ansible to run the cloud-info-provider

Everything is managed automatically via GitHub actions, on pull-requests
Everything is managed automatically via GitHub Actions, on pull-requests
the terraform plan is updated and when merging, it's applied and
ansible is run on the resulting infrastructure.

### Secrets

Secrets are stored in GitHub. These include:

- `ANSIBLE_SECRETS`: `yaml` file with robot account credentials and AMS token
for pushing messages
- `APP_ID` and `APP_PRIVATE_KEY`: credentials for GitHub app capable of
Expand Down
6 changes: 3 additions & 3 deletions deploy/cloud-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ write_files:
./deploy.sh "$OAUTH_TOKEN" "$COMMIT_SHA" "$FEDCLOUD_LOCKER_TOKEN" \
"$TAGS" "$SHORT_COMMIT_SHA" "$SLACK_WEBHOOK_URL"
path: /var/lib/cloud/scripts/per-boot/deploy.sh
permissions: '0755'
permissions: "0755"
- content: |
#!/bin/sh
Expand All @@ -58,7 +58,7 @@ write_files:
retry -t 10 -d 90 -- openstack --os-cloud backend object create \
--name "$VM_ID" fedcloud-catchall "/var/tmp/egi/$VM_ID"
path: /usr/local/bin/notify.sh
permissions: '0755'
permissions: "0755"
- content: |
[Unit]
Description=Notify the github action
Expand All @@ -72,4 +72,4 @@ write_files:
- content: "%CLOUDS_YAML%"
encoding: base64
path: /etc/openstack/clouds.yaml
permissions: '0644'
permissions: "0644"
4 changes: 2 additions & 2 deletions deploy/roles/catchall/tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
state: directory
mode: "775"
notify:
- Restart docker
- Restart docker

- name: Configure docker
ansible.builtin.copy:
Expand All @@ -54,4 +54,4 @@
dest: /etc/docker/daemon.json
mode: "660"
notify:
- Restart docker
- Restart docker
3 changes: 1 addition & 2 deletions deploy/roles/catchall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
apply:
tags: "docker"
# this is only executed if explicity requested
tags: ['never', 'docker']
tags: ["never", "docker"]

- name: Load site configuration
tags: ["cloud-info", "image-sync"]
Expand Down Expand Up @@ -53,7 +53,6 @@
- "{{ sites }}"
when: sites is iterable


- name: Image sync config
tags: ["image-sync"]
ansible.builtin.include_tasks:
Expand Down
24 changes: 12 additions & 12 deletions deploy/roles/catchall/templates/cloud-info.env.j2
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
AMS_HOST={{ ams_host }}
AMS_PROJECT={{ ams_project }}
AMS_TOKEN={{ ams_token }}
CHECKIN_OIDC_TOKEN={{ checkin.token_endpoint }}
CHECKIN_SECRETS_PATH=/etc/egi/vos/
CLOUD_INFO_CONFIG=/etc/egi/cloud-info/{{ filename }}.yaml
OS_AUTH_TYPE=v3oidcaccesstoken
OS_AUTH_URL={{ site.endpoint }}
OS_IDENTITY_PROVIDER=egi.eu
OS_PROTOCOL={{ site.protocol | default('openid') }}
AMS_HOST="{{ ams_host }}"
AMS_PROJECT="{{ ams_project }}"
AMS_TOKEN="{{ ams_token }}"
CHECKIN_OIDC_TOKEN="{{ checkin.token_endpoint }}"
CHECKIN_SECRETS_PATH="/etc/egi/vos/""
CLOUD_INFO_CONFIG="/etc/egi/cloud-info/{{ filename }}.yaml"
OS_AUTH_TYPE="v3oidcaccesstoken"
OS_AUTH_URL="{{ site.endpoint }}"
OS_IDENTITY_PROVIDER="egi.eu"
OS_PROTOCOL={{ site.protocol | default('openid') }}"
{% if "region" in site %}
OS_REGION={{ site.region }}
OS_REGION="{{ site.region }}"
{% endif %}
SITE_NAME={{ site.gocdb }}
SITE_NAME="{{ site.gocdb }}"
48 changes: 24 additions & 24 deletions sites/BIFI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
gocdb: BIFI
endpoint: https://colossus.cesar.unizar.es:5000/v3
vos:
- name: covid19.eosc-synergy.eu
auth:
project_id: f07679a8d4ac40379b51db4236bc3c27
- name: eosc-synergy.eu
auth:
project_id: 0c1de26753ed4311a6cefff9094ad3e3
- name: lagoproject.net
auth:
project_id: 21a85c6ead0346b08e22709d0422799d
- name: o3as.data.kit.edu
auth:
project_id: 621b1977bb384beab1519713c7e695f0
- name: ops
auth:
project_id: 6930771153aa4b8d8637222dec8fd949
- name: worsica.vo.incd.pt
auth:
project_id: 46f55a92f3904d509d75525930d8d0eb
- name: vo.phiri.eu
auth:
project_id: 1d64c6e5237b46af8acb44f79b7b5a15
- name: vo.bd4nrg.eu
auth:
project_id: 3e18859848be489a8d741b264049f4a9
- name: covid19.eosc-synergy.eu
auth:
project_id: f07679a8d4ac40379b51db4236bc3c27
- name: eosc-synergy.eu
auth:
project_id: 0c1de26753ed4311a6cefff9094ad3e3
- name: lagoproject.net
auth:
project_id: 21a85c6ead0346b08e22709d0422799d
- name: o3as.data.kit.edu
auth:
project_id: 621b1977bb384beab1519713c7e695f0
- name: ops
auth:
project_id: 6930771153aa4b8d8637222dec8fd949
- name: worsica.vo.incd.pt
auth:
project_id: 46f55a92f3904d509d75525930d8d0eb
- name: vo.phiri.eu
auth:
project_id: 1d64c6e5237b46af8acb44f79b7b5a15
- name: vo.bd4nrg.eu
auth:
project_id: 3e18859848be489a8d741b264049f4a9
20 changes: 10 additions & 10 deletions sites/CENI.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
gocdb: CENI
gocdb: CENI
endpoint: https://openstack.ceni.org.cn:5000/v3
vos:
- name: ops
auth:
project_id: 90c0ce1b2f1545c0b9a05d9a8fd45102
- name: vo.access.egi.eu
auth:
project_id: b106744c783543518f505dda45632697
- name: vo.cnic.cn
auth:
project_id: 3105c59401794130821a68e219726ccc
- name: ops
auth:
project_id: 90c0ce1b2f1545c0b9a05d9a8fd45102
- name: vo.access.egi.eu
auth:
project_id: b106744c783543518f505dda45632697
- name: vo.cnic.cn
auth:
project_id: 3105c59401794130821a68e219726ccc
Loading

0 comments on commit 353d3e5

Please sign in to comment.