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

Add new service account (WIP) #312

Closed
wants to merge 18 commits into from

Conversation

enolfc
Copy link
Contributor

@enolfc enolfc commented Oct 13, 2023

Summary

Starts moving towards the use access tokens obtained from client credentials grant based service account. For now, it will be only applied to those providers than have properly VO tags in their configuration. Others should not see any effect here.

Tests performed:

Working site:

  1. New code
$ sudo docker run -it --rm -v  /etc/egi:/etc/egi:ro --env-file /etc/egi/cloud-info/CESNET-MCC-4bea1f78e9ab4ecd959a2bfbeeb111c7.env cloud-info/test:latest bash
# publisher.sh
WARNING:root:Discarding project service-account-90376025-bce4-4958-9870-1acec380a966 as it does not have VO property
WARNING:root:Discarding project vo.elixir-europe.org as it does not have VO property
WARNING:root:Unexpected issue while getting json for ''{ad:appid: 934}''
{
   "messageIds": [
      "263895"
   ]
}# grep GLUE2PolicyRule cloud-info.out | sort -u | wc
     31      62    1112
  1. Old code:
$ sudo docker run -it --rm -v /etc/egi:/etc/egi:ro --env-file /etc/egi/cloud-info/CESNET-MCC-4bea1f78e9ab4ecd959a2bfbeeb111c7.env  ghcr.io/egi-federation/fedcloud-cloud-info:sha-d2e98ca bash
root@983b0851fcc5:/# publisher.sh
WARNING:root:Discarding project in-sar-cubes.c-scale.eu as it is not enabled
WARNING:root:Discarding project sfedcloudops as it does not have VO property
WARNING:root:Discarding project srobotops as it does not have VO property
WARNING:root:Unexpected issue while getting json for ''{ad:appid: 934}''
{
   "messageIds": [
      "263898"
   ]
}root@983b0851fcc5:/# grep GLUE2PolicyRule cloud-info.out | sort -u | wc
     25      50     889

6 more VOs published

Site without VO property

No changes in behaviour:

  1. Test with new code:
$ docker run -it --rm -v /etc/egi:/etc/egi:ro --env-file /etc/egi/cloud-info/SCAI-f74e0d800af7302143c72648adf96630.env cloud-info/test:latest bash
root@84efc5c74508:/# publisher.sh
WARNING:root:Discarding project vo.ebrain-health.eu as it does not have VO property
WARNING:root:Discarding project ops as it does not have VO property
WARNING:root:Discarding project vo.access.egi.eu as it does not have VO property
WARNING:root:Discarding project vo.fuvex.es as it does not have VO property
ERROR:root:No shares generated!
Traceback (most recent call last):
  File "/usr/local/bin/config-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 78, in main
    shares_config = generate_shares_config(config, secrets)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 61, in generate_shares_config
    shares = generate_shares(config, secrets)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 56, in generate_shares
    raise Exception("No shares found!")
Exception: No shares found!
{
   "messageIds": [
      "63792"
   ]
}root@84efc5c74508# grep GLUE2PolicyRule cloud-info.out | sort -u | wc
      4       8     133
  1. With old code
$ sudo docker run -it --rm -v /etc/egi:/etc/egi:ro --env-file /etc/egi/cloud-info/SCAI-f74e0d800af7302143c72648adf96630.env ghcr.io/egi-federation/fedcloud-cloud-info:sha-d2e98ca bash
root@e9857a692cdd:/# publisher.sh
WARNING:root:Discarding project vo.ebrain-health.eu as it does not have VO property
WARNING:root:Discarding project vo.access.egi.eu as it does not have VO property
WARNING:root:Discarding project vo.fuvex.es as it does not have VO property
WARNING:root:Discarding project ops as it does not have VO property
ERROR:root:No shares generated!
Traceback (most recent call last):
  File "/usr/local/bin/config-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 111, in main
    config = disc.generate_config(site_name, secrets)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 88, in generate_config
    shares = self.generate_shares(secrets)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cloud_info_catchall/config_generator.py", line 84, in generate_shares
    raise Exception("No shares found!")
Exception: No shares found!
{
   "messageIds": [
      "63795"
   ]
} root@e9857a692cdd:/# grep GLUE2PolicyRule cloud-info.out | sort -u | wcc
      4       8     133

Related issue : #89, #277

Also upgrade cloud-info-provider
@enolfc enolfc requested review from a team as code owners October 13, 2023 14:52
@enolfc enolfc marked this pull request as draft October 16, 2023 08:25
@enolfc enolfc marked this pull request as ready for review October 17, 2023 10:47
@enolfc enolfc requested a review from gwarf October 17, 2023 10:47
@enolfc
Copy link
Contributor Author

enolfc commented Oct 17, 2023

Closing and opening it again as a branch of the EGI-Federation repo

@enolfc enolfc closed this Oct 17, 2023
@enolfc enolfc mentioned this pull request Oct 17, 2023
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.

2 participants