Skip to content

Commit

Permalink
Remove vo.e-rihs.eu from list (#384)
Browse files Browse the repository at this point in the history
* Remove vo.e-rihs.eu from list

* Better GitHub integration

* Fix linting issue

* Better output
  • Loading branch information
enolfc authored Dec 11, 2024
1 parent df8836b commit cb9b753
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
25 changes: 11 additions & 14 deletions validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ curl --silent "http://cclavoisier01.in2p3.fr:8080/lavoisier/VoList?accept=json"

# Get fedcloudclient sites
FEDCLOUD_CLI_SITES=$(mktemp)
curl "https://raw.githubusercontent.com/tdviet/fedcloudclient/master/config/sites.yaml" \
curl --silent "https://raw.githubusercontent.com/tdviet/fedcloudclient/master/config/sites.yaml" \
>"$FEDCLOUD_CLI_SITES"

# Temp file for nova endpoint
Expand All @@ -20,56 +20,53 @@ NOVA_ENDPOINT=$(mktemp)
for f in sites/*.yaml; do
goc_site=$(grep "^gocdb:" "$f" | cut -f2 -d":" | tr -d "[:space:]")
endpoint=$(grep "^endpoint:" "$f" | cut -f2- -d":" | tr -d "[:space:]")
printf "Searching for endpoint %s in %s site (%s)\n" \
"$endpoint" "$goc_site" "$f"
echo "::debug::Searching for endpoint $endpoint in $goc_site site ($f)"
curl --silent "$goc_method&sitename=$goc_site&service_type=org.openstack.nova" \
>"$NOVA_ENDPOINT"
if ! grep -q "<SITENAME>$goc_site</SITENAME>" "$NOVA_ENDPOINT"; then
printf "\033[0;31m[ERROR] Site %s not found in GOC\033[0m\n" "$goc_site"
echo "::error file=$f title=Missing site::Site $goc_site not found in GOC"
exit_value=1
continue
fi
if ! grep -q "<URL>$endpoint</URL>" "$NOVA_ENDPOINT"; then
printf "\033[0;31m[ERROR] URL %s for %s not found in GOC\033[0m\n" \
"$endpoint" "$goc_site"
echo "::error file=$f title=URL not found::URL $endpoint for $goc_site not found in GOC"
exit_value=1
else
printf "\033[0;32m[OK]\033[0m\n"
echo "::notice file=$f title=OK::Site $goc_site is ok"
fi
# check if all VOs configured do exist
# Try to use FQAN
# So the VO that comes from the file, it will be either:
# - just the name of the VO
# - /<name of the VO>/some more extra/
# - /VO=<name of the VO>/some more stuff/
# Won't cause error in validation!
for vo in $(yq -r ".vos[].name" <"$f" | cut -f2 -d"/" | sed "s/^VO=//"); do
if ! grep -q "^$vo\$" "$VO_LIST"; then
printf "\033[0;31m[ERROR] VO %s not found in ops portal\033[0m\n" \
"$vo"
exit_value=1
echo "::warning file=$f title=VO not in ops portal::VO $vo not found in ops portal"
fi
done

# check if site is also on:
# https://github.com/tdviet/fedcloudclient/blob/master/config/sites.yaml
if ! grep -q "$f" "$FEDCLOUD_CLI_SITES"; then
printf "\033[0;31m[ERROR] Site %s not found in fedcloudclient\033[0m\n" "$goc_site"
echo "::error file=$f title=Site not in fedcloudclient::Site $goc_site not found in fedcloudclient"
exit_value=1
fi
done

for site in $(yq -r '.[]' <"$FEDCLOUD_CLI_SITES"); do
if ! test -s "sites/$(basename "$site")"; then
printf "\033[0;31m[ERROR] Site %s not found in fedcloud-catchall-operations\033[0m\n" "$(basename "$site")"
echo "::error::Site $(basename "$site") not found in fedcloud-catchall-operations"
exit_value=1
fi
done

# check that the VO mappings are up to date according to ops portal
for vo in $(yq -r '.vos | keys[]' <vo-mappings.yaml | cut -f2 -d"/" | sed "s/^VO=//"); do
if ! grep -q "^$vo\$" "$VO_LIST"; then
printf "\033[0;31m[ERROR] VO %s not found in ops portal\033[0m\n" \
"$vo"
line="$(grep -n "$vo" vo-mappings.yaml | head -1 | cut -f1 -d:)"
echo "::error file=vo-mappings.yaml line=$line title=VO not in ops portal::VO $vo not found in ops portal"
exit_value=1
fi
done
Expand Down
1 change: 0 additions & 1 deletion vo-mappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ vos:
vo.ebrain-health.eu: "urn:mace:egi.eu:group:vo.ebrain-health.eu:role=vm_operator#aai.egi.eu"
vo.elixir-europe.org: "urn:mace:egi.eu:group:vo.elixir-europe.org:role=vm_operator#aai.egi.eu"
vo.eoscfuture-sp.panosc.eu: "urn:mace:egi.eu:group:vo.eoscfuture-sp.panosc.eu:role=vm_operator#aai.egi.eu"
vo.e-rihs.eu: "urn:mace:egi.eu:group:vo.e-rihs.eu:role=vm_operator#aai.egi.eu"
vo.emphasisproject.eu: "urn:mace:egi.eu:group:vo.emphasisproject.eu:role=vm_operator#aai.egi.eu"
vo.emso-eric.eu: "urn:mace:egi.eu:group:vo.emso-eric.eu:role=vm_operator#aai.egi.eu"
vo.enes.org: "urn:mace:egi.eu:group:vo.enes.org:role=vm_operator#aai.egi.eu"
Expand Down

0 comments on commit cb9b753

Please sign in to comment.