diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6bfcb999..32afcb45 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,8 +17,6 @@ jobs: image: - cloud-info - caso - - cloudkeeper-os - - cloudkeeper-core steps: - name: Checkout diff --git a/cloud-info/ams-wrapper.sh b/cloud-info/ams-wrapper.sh index a69c02e0..1d8504f5 100755 --- a/cloud-info/ams-wrapper.sh +++ b/cloud-info/ams-wrapper.sh @@ -85,7 +85,7 @@ grep -q GLUE2ShareID cloud-info.out \ ARGO_URL="https://$AMS_HOST/v1/projects/$AMS_PROJECT/topics/$AMS_TOPIC:publish?key=$AMS_TOKEN" printf '{"messages":[{"attributes":{},"data":"' > ams-payload -grep -v "UNKNOWN" cloud-info.out | grep -v "^#" | gzip | base64 -w 0 >> ams-payload +grep -v "UNKNOWN" cloud-info.out | grep -v "^#" | grep -v ": $" | gzip | base64 -w 0 >> ams-payload printf '"}]}' >> ams-payload curl -X POST "$ARGO_URL" -H "content-type: application/json" -d @ams-payload diff --git a/cloudkeeper-core/Dockerfile b/cloudkeeper-core/Dockerfile deleted file mode 100644 index 3e95390e..00000000 --- a/cloudkeeper-core/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM ruby:2.6 - -LABEL org.opencontainers.image.source=https://github.com/EGI-Federation/fedcloud-catchall-operations - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -# We do need install recommends for the CAs -# hadolint ignore=DL3015, DL3008 -RUN apt-get update \ - && apt-get -qy install --fix-missing --no-install-recommends curl qemu-utils \ - && curl https://dl.igtf.net/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3 | apt-key add - \ - && echo 'deb http://repository.egi.eu/sw/production/cas/1/current egi-igtf core' \ - > /etc/apt/sources.list.d/cas.list \ - && apt-get update \ - && apt-get -qy install --fix-missing fetch-crl \ - && apt-get -qy install --fix-missing ca-policy-egi-core \ - && apt-get clean autoclean \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /tmp/*.deb - -RUN fetch-crl -p 2 -T 30 || exit 0 - -RUN gem install google-protobuf -v 3.23.4 \ - && gem install cloudkeeper -v 1.7.1 - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -COPY image-lists.conf /etc/cloudkeeper/image-lists.conf -COPY cloudkeeper.yml /etc/cloudkeeper/cloudkeeper.yml - -RUN mkdir -p /var/log/cloudkeeper \ - /var/lock/cloudkeeper \ - /var/spool/cloudkeeper/images - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["cloudkeeper", "sync"] diff --git a/cloudkeeper-core/cloudkeeper.yml b/cloudkeeper-core/cloudkeeper.yml deleted file mode 100644 index ffd76299..00000000 --- a/cloudkeeper-core/cloudkeeper.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -cloudkeeper: - image-lists-file: /etc/cloudkeeper/image-lists.conf - ca-dir: /etc/grid-security/certificates/ # CA directory - authentication: false # core (client) <-> backend (server) authentication (certificate, key and backend-certificate options) - certificate: /etc/grid-security/hostcert.pem # Core's host certificate - key: /etc/grid-security/hostkey.pem # Core's host key - image-dir: /var/spool/cloudkeeper/images/ # Directory to store images to - external-tools: - binaries: - qemu-img: /usr/bin/qemu-img # qemu-img binary (image conversion) location - nginx: /usr/bin/nginx # nginx binary (HTTP server) location - execution-timeout: 600 # timeout for execution of external tools in seconds - remote-mode: false # Remote mode starts HTTP server (NGINX) and serves images to backend via HTTP - nginx: - runtime-dir: /var/run/cloudkeeper/ # Runtime directory for NGINX - error-log-file: /var/log/cloudkeeper/nginx-error.log # File for NGINX error log - access-log-file: /var/log/cloudkeeper/nginx-access.log # File for NGINX access log - pid-file: /var/run/cloudkeeper/nginx.pid # NGINX pid file - ip-address: 127.0.0.1 # IP address NGINX can listen on - port: 50505 # Port NGINX can listen on - proxy: - ip-address: # Proxy IP address - port: # Proxy port - ssl: false # Whether proxy will use SSL connection - backend: - endpoint: 127.0.0.1:50051 # Backend's gRPC endpoint - certificate: /etc/grid-security/backendcert.pem # Backend's certificate - formats: # List of acceptable formats images can be converted to - - qcow2 - logging: - level: ERROR # Logging level - file: /var/log/cloudkeeper/cloudkeeper.log # File to write log to. To turn off file logging leave this field empty. - lock-file: /var/lock/cloudkeeper/cloudkeeper.lock # File used to ensure only one running instance of cloudkeeper - debug: false # Debug mode diff --git a/cloudkeeper-core/entrypoint.sh b/cloudkeeper-core/entrypoint.sh deleted file mode 100755 index 1f42289d..00000000 --- a/cloudkeeper-core/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [ "$DEBUG" = "1" ] ; then - set -x -fi - -EXTRA_OPTS=() - -if [ "$BACKEND_PORT_50051_TCP_ADDR" != "" ]; then - EXTRA_OPTS=("${EXTRA_OPTS[@]}" --backend-endpoint="$BACKEND_PORT_50051_TCP_ADDR:$BACKEND_PORT_50051_TCP_PORT") -fi - -exec "$@" "${EXTRA_OPTS[@]}" diff --git a/cloudkeeper-core/image-lists.conf b/cloudkeeper-core/image-lists.conf deleted file mode 100644 index 6155091b..00000000 --- a/cloudkeeper-core/image-lists.conf +++ /dev/null @@ -1,3 +0,0 @@ -# One image list per line -# Lines can be commented if started with "#" -https://APPDB_TOKEN:x-oauth-basic@vmcaster.appdb.egi.eu/store/vo/ops/image.list diff --git a/cloudkeeper-os/Dockerfile b/cloudkeeper-os/Dockerfile deleted file mode 100644 index 0abc784e..00000000 --- a/cloudkeeper-os/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM centos:7 - -LABEL org.opencontainers.image.source=https://github.com/EGI-Federation/fedcloud-catchall-operations - -COPY cloudkeeper.repo /etc/yum.repos.d/cloudkeeper.repo - -# hadolint ignore=DL3033 -RUN yum install -y centos-release-openstack-stein \ - && yum install -y cloudkeeper-os \ - && yum clean all - -RUN mkdir -p /etc/cloudkeeper-os/ \ - /var/spool/cloudkeeper/images - -COPY cloudkeeper-os.conf /etc/cloudkeeper-os/cloudkeeper-os.conf -COPY mapping.json /etc/cloudkeeper-os/mapping.json - -# Patch the cloudkeeper-os -COPY openstack_client.py /usr/lib/python2.7/site-packages/cloudkeeper_os/openstack_client.py -RUN python -m compileall /usr/lib/python2.7/site-packages/cloudkeeper_os/openstack_client.py - -EXPOSE 50051 - -CMD ["cloudkeeper-os"] diff --git a/cloudkeeper-os/cloudkeeper-os.conf b/cloudkeeper-os/cloudkeeper-os.conf deleted file mode 100644 index f2823011..00000000 --- a/cloudkeeper-os/cloudkeeper-os.conf +++ /dev/null @@ -1,136 +0,0 @@ -[DEFAULT] - -# -# From cloudkeeper_os.config -# - -# The port on which the server will listen. (port value) -# Minimum value: 0 -# Maximum value: 65535 -#grpc_port = 50051 - -# Directory where the cloud credentials for each VO are stored. (string value) -#mapping_file = /etc/cloudkeeper-os/voms.json - - -# Directory where the images are downloaded (string value) -#tempdir = /tmp - -# -# From oslo.log -# - -# If set to true, the logging level will be set to DEBUG instead of the default -# INFO level. (boolean value) -# Note: This option can be changed without restarting. -#debug = false - -# DEPRECATED: If set to false, the logging level will be set to WARNING instead -# of the default INFO level. (boolean value) -# This option is deprecated for removal. -# Its value may be silently ignored in the future. -#verbose = true - -# The name of a logging configuration file. This file is appended to any -# existing logging configuration files. For details about logging configuration -# files, see the Python logging module documentation. Note that when logging -# configuration files are used then all logging configuration is set in the -# configuration file and other logging configuration options are ignored (for -# example, logging_context_format_string). (string value) -# Note: This option can be changed without restarting. -# Deprecated group/name - [DEFAULT]/log_config -#log_config_append = - -# Defines the format string for %%(asctime)s in log records. Default: -# %(default)s . This option is ignored if log_config_append is set. (string -# value) -#log_date_format = %Y-%m-%d %H:%M:%S - -# (Optional) Name of log file to send logging output to. If no default is set, -# logging will go to stderr as defined by use_stderr. This option is ignored if -# log_config_append is set. (string value) -# Deprecated group/name - [DEFAULT]/logfile -#log_file = - -# (Optional) The base directory used for relative log_file paths. This option -# is ignored if log_config_append is set. (string value) -# Deprecated group/name - [DEFAULT]/logdir -#log_dir = - -# Uses logging handler designed to watch file system. When log file is moved or -# removed this handler will open a new log file with specified path -# instantaneously. It makes sense only if log_file option is specified and -# Linux platform is used. This option is ignored if log_config_append is set. -# (boolean value) -#watch_log_file = false - -# Use syslog for logging. Existing syslog format is DEPRECATED and will be -# changed later to honor RFC5424. This option is ignored if log_config_append -# is set. (boolean value) -#use_syslog = false - -# Syslog facility to receive log lines. This option is ignored if -# log_config_append is set. (string value) -#syslog_log_facility = LOG_USER - -# Log output to standard error. This option is ignored if log_config_append is -# set. (boolean value) -#use_stderr = true - -# Format string to use for log messages with context. (string value) -#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s - -# Format string to use for log messages when context is undefined. (string -# value) -#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s - -# Additional data to append to log message when logging level for the message -# is DEBUG. (string value) -#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d - -# Prefix each line of exception output with this format. (string value) -#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s - -# Defines the format string for %(user_identity)s that is used in -# logging_context_format_string. (string value) -#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s - -# List of package logging levels in logger=LEVEL pairs. This option is ignored -# if log_config_append is set. (list value) -#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO - -# Enables or disables publication of error events. (boolean value) -#publish_errors = false - -# The format for an instance that is passed with the log message. (string -# value) -#instance_format = "[instance: %(uuid)s] " - -# The format for an instance UUID that is passed with the log message. (string -# value) -#instance_uuid_format = "[instance: %(uuid)s] " - -# Enables or disables fatal status of deprecations. (boolean value) -#fatal_deprecations = false - - -[keystone_authtoken] - -# -# From cloudkeeper_os.config -# - -# Username (string value) -#username = cloudkeeper - -# User's password (string value) -#password = - -# User's domain name (string value) -#user_domain_name = default - -# Domain name containing project (string value) -#project_domain_name = default - -# Complete public Identity API endpoint. (string value) -#auth_url = diff --git a/cloudkeeper-os/cloudkeeper.repo b/cloudkeeper-os/cloudkeeper.repo deleted file mode 100644 index 03a372a9..00000000 --- a/cloudkeeper-os/cloudkeeper.repo +++ /dev/null @@ -1,9 +0,0 @@ -# EGI Applications Database (http://appdb.egi.eu/) -# EGI Community repository (http://repository.egi.eu/community/) -# POA ID:1142 -# Created: 2022-03-30 15:04:59 EEST -[cloudkeeper.os-sl-7-x86_64] -name=Repository for cloudkeeper.os (o/s: sl7 arch: x86_64) -baseurl=https://repository.egi.eu/community/software/cloudkeeper.os/0.9.x/releases/sl/7/x86_64/RPMS/ -enabled=1 -gpgcheck=0 diff --git a/cloudkeeper-os/mapping.json b/cloudkeeper-os/mapping.json deleted file mode 100644 index 4890f1b2..00000000 --- a/cloudkeeper-os/mapping.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "fedcloud.egi.eu": { - "tenant": "mytenant" - } -} diff --git a/cloudkeeper-os/openstack_client.py b/cloudkeeper-os/openstack_client.py deleted file mode 100644 index ce636c94..00000000 --- a/cloudkeeper-os/openstack_client.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright 2017 CNRS and University of Strasbourg -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""Keystone helper -""" - -import glanceclient.v2.client as glanceclient -import webob.exc -from keystoneauth1 import exceptions, session -from keystoneauth1.identity import v3 -from oslo_config import cfg -from oslo_log import log - -CONF = cfg.CONF -LOG = log.getLogger(__name__) - -CFG_GROUP = "keystone_authtoken" - - -def get_session(project_name, domain_name): - """Get an auth session.""" - try: - # attempt with project_id - auth_params = dict(CONF[CFG_GROUP]) - auth_params.update(dict(project_id=project_name)) - auth = v3.Password(**auth_params) - sess = session.Session(auth=auth, verify=False) - sess.get_token() - except exceptions.Unauthorized: - # attempt with project_name - auth_params = dict(CONF[CFG_GROUP]) - auth_params.update(dict(project_name=project_name, domain_name=domain_name)) - auth = v3.Password(**auth_params) - sess = session.Session(auth=auth, verify=False) - return sess - - -def get_glance_client(project_name, domain_name): - """Get a glance client""" - LOG.debug("Get a glance client for the project: '%s'" % project_name) - - endpoint_type = CONF.endpoint_type - try: - sess = get_session(project_name=project_name, domain_name=domain_name) - if endpoint_type: - LOG.debug( - "Glance client is accessing Glance through the " - "following endpoint type: %s" % endpoint_type - ) - glance_client = glanceclient.Client(session=sess, interface=endpoint_type) - else: - glance_client = glanceclient.Client(session=sess) - except webob.exc.HTTPForbidden as err: - LOG.error("Connection to Glance failed.") - LOG.exception(err) - return None - return glance_client