diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 690d9a23..d7ae8d88 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -1460,11 +1460,10 @@ def delete_backend(self, id): LOG.exception(e) return str(-1) - def add_user_to_backend(self, backend_id, owner_id, user_id): + def add_user_to_backend(self, backend_id, user_id): try: post_url = f"{self.RE_BACKEND_URL}{self.USERS_URL}/{backend_id}" user_info = { - "owner": owner_id, "user": user_id, } except Exception as e: @@ -1513,10 +1512,9 @@ def get_users_from_backend(self, backend_id): LOG.info(msg=f"Get users for backend timed out. {e}") return [] - def delete_user_from_backend(self, backend_id, owner_id, user_id): + def delete_user_from_backend(self, backend_id, user_id): delete_url = f"{self.RE_BACKEND_URL}{self.USERS_URL}/{backend_id}" user_info = { - "owner": owner_id, "user": user_id, } try: @@ -2185,6 +2183,13 @@ def start_cluster(self, public_key, master_instance, worker_instances, user): "masterInstance": master_instance, "workerInstances": wI, "useMasterWithPublicIp": False, + "ansibleGalaxyRoles": [ + { + "name": "autoscaling", + "hosts": "master", + "git": "https://github.com/patricS4/autoscaling-config-ansible", + } + ], } for mode in self.BIBIGRID_MODES: body.update({mode: True}) diff --git a/VirtualMachineService/VirtualMachineService-remote b/VirtualMachineService/VirtualMachineService-remote index 1f6a36a1..ca73d5f4 100755 --- a/VirtualMachineService/VirtualMachineService-remote +++ b/VirtualMachineService/VirtualMachineService-remote @@ -80,11 +80,9 @@ if len(sys.argv) <= 1 or sys.argv[1] == "--help": print(" get_backends_by_template(string template)") print(" Backend get_backend_by_id(i64 id)") print(" string delete_backend(i64 id)") - print(" add_user_to_backend(i64 backend_id, string owner_id, string user_id)") + print(" add_user_to_backend(i64 backend_id, string user_id)") print(" get_users_from_backend(i64 backend_id)") - print( - " delete_user_from_backend(i64 backend_id, string owner_id, string user_id)" - ) + print(" delete_user_from_backend(i64 backend_id, string user_id)") print(" get_templates()") print(" get_allowed_templates()") print(" get_templates_by_template(string template_name)") @@ -585,14 +583,13 @@ elif cmd == "delete_backend": ) elif cmd == "add_user_to_backend": - if len(args) != 3: - print("add_user_to_backend requires 3 args") + if len(args) != 2: + print("add_user_to_backend requires 2 args") sys.exit(1) pp.pprint( client.add_user_to_backend( eval(args[0]), args[1], - args[2], ) ) @@ -607,14 +604,13 @@ elif cmd == "get_users_from_backend": ) elif cmd == "delete_user_from_backend": - if len(args) != 3: - print("delete_user_from_backend requires 3 args") + if len(args) != 2: + print("delete_user_from_backend requires 2 args") sys.exit(1) pp.pprint( client.delete_user_from_backend( eval(args[0]), args[1], - args[2], ) ) diff --git a/VirtualMachineService/VirtualMachineService.py b/VirtualMachineService/VirtualMachineService.py index fb367e61..3a26a91c 100644 --- a/VirtualMachineService/VirtualMachineService.py +++ b/VirtualMachineService/VirtualMachineService.py @@ -414,13 +414,12 @@ def delete_backend(self, id): """ - def add_user_to_backend(self, backend_id, owner_id, user_id): + def add_user_to_backend(self, backend_id, user_id): """ Add a user to a backend Parameters: - backend_id - - owner_id - user_id """ @@ -434,13 +433,12 @@ def get_users_from_backend(self, backend_id): """ - def delete_user_from_backend(self, backend_id, owner_id, user_id): + def delete_user_from_backend(self, backend_id, user_id): """ Delete user from a backend Parameters: - backend_id - - owner_id - user_id """ @@ -2400,26 +2398,24 @@ def recv_delete_backend(self): "delete_backend failed: unknown result", ) - def add_user_to_backend(self, backend_id, owner_id, user_id): + def add_user_to_backend(self, backend_id, user_id): """ Add a user to a backend Parameters: - backend_id - - owner_id - user_id """ - self.send_add_user_to_backend(backend_id, owner_id, user_id) + self.send_add_user_to_backend(backend_id, user_id) return self.recv_add_user_to_backend() - def send_add_user_to_backend(self, backend_id, owner_id, user_id): + def send_add_user_to_backend(self, backend_id, user_id): self._oprot.writeMessageBegin( "add_user_to_backend", TMessageType.CALL, self._seqid ) args = add_user_to_backend_args() args.backend_id = backend_id - args.owner_id = owner_id args.user_id = user_id args.write(self._oprot) self._oprot.writeMessageEnd() @@ -2482,26 +2478,24 @@ def recv_get_users_from_backend(self): "get_users_from_backend failed: unknown result", ) - def delete_user_from_backend(self, backend_id, owner_id, user_id): + def delete_user_from_backend(self, backend_id, user_id): """ Delete user from a backend Parameters: - backend_id - - owner_id - user_id """ - self.send_delete_user_from_backend(backend_id, owner_id, user_id) + self.send_delete_user_from_backend(backend_id, user_id) return self.recv_delete_user_from_backend() - def send_delete_user_from_backend(self, backend_id, owner_id, user_id): + def send_delete_user_from_backend(self, backend_id, user_id): self._oprot.writeMessageBegin( "delete_user_from_backend", TMessageType.CALL, self._seqid ) args = delete_user_from_backend_args() args.backend_id = backend_id - args.owner_id = owner_id args.user_id = user_id args.write(self._oprot) self._oprot.writeMessageEnd() @@ -4936,7 +4930,7 @@ def process_add_user_to_backend(self, seqid, iprot, oprot): result = add_user_to_backend_result() try: result.success = self._handler.add_user_to_backend( - args.backend_id, args.owner_id, args.user_id + args.backend_id, args.user_id ) msg_type = TMessageType.REPLY except TTransport.TTransportException: @@ -4988,7 +4982,7 @@ def process_delete_user_from_backend(self, seqid, iprot, oprot): result = delete_user_from_backend_result() try: result.success = self._handler.delete_user_from_backend( - args.backend_id, args.owner_id, args.user_id + args.backend_id, args.user_id ) msg_type = TMessageType.REPLY except TTransport.TTransportException: @@ -13928,7 +13922,6 @@ class add_user_to_backend_args(object): """ Attributes: - backend_id - - owner_id - user_id """ @@ -13936,11 +13929,9 @@ class add_user_to_backend_args(object): def __init__( self, backend_id=None, - owner_id=None, user_id=None, ): self.backend_id = backend_id - self.owner_id = owner_id self.user_id = user_id def read(self, iprot): @@ -13962,15 +13953,6 @@ def read(self, iprot): else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.STRING: - self.owner_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) - else: - iprot.skip(ftype) - elif fid == 3: if ftype == TType.STRING: self.user_id = ( iprot.readString().decode("utf-8", errors="replace") @@ -13995,16 +13977,8 @@ def write(self, oprot): oprot.writeFieldBegin("backend_id", TType.I64, 1) oprot.writeI64(self.backend_id) oprot.writeFieldEnd() - if self.owner_id is not None: - oprot.writeFieldBegin("owner_id", TType.STRING, 2) - oprot.writeString( - self.owner_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.owner_id - ) - oprot.writeFieldEnd() if self.user_id is not None: - oprot.writeFieldBegin("user_id", TType.STRING, 3) + oprot.writeFieldBegin("user_id", TType.STRING, 2) oprot.writeString( self.user_id.encode("utf-8") if sys.version_info[0] == 2 @@ -14041,17 +14015,10 @@ def __ne__(self, other): ( 2, TType.STRING, - "owner_id", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, "user_id", "UTF8", None, - ), # 3 + ), # 2 ) @@ -14324,7 +14291,6 @@ class delete_user_from_backend_args(object): """ Attributes: - backend_id - - owner_id - user_id """ @@ -14332,11 +14298,9 @@ class delete_user_from_backend_args(object): def __init__( self, backend_id=None, - owner_id=None, user_id=None, ): self.backend_id = backend_id - self.owner_id = owner_id self.user_id = user_id def read(self, iprot): @@ -14358,15 +14322,6 @@ def read(self, iprot): else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.STRING: - self.owner_id = ( - iprot.readString().decode("utf-8", errors="replace") - if sys.version_info[0] == 2 - else iprot.readString() - ) - else: - iprot.skip(ftype) - elif fid == 3: if ftype == TType.STRING: self.user_id = ( iprot.readString().decode("utf-8", errors="replace") @@ -14391,16 +14346,8 @@ def write(self, oprot): oprot.writeFieldBegin("backend_id", TType.I64, 1) oprot.writeI64(self.backend_id) oprot.writeFieldEnd() - if self.owner_id is not None: - oprot.writeFieldBegin("owner_id", TType.STRING, 2) - oprot.writeString( - self.owner_id.encode("utf-8") - if sys.version_info[0] == 2 - else self.owner_id - ) - oprot.writeFieldEnd() if self.user_id is not None: - oprot.writeFieldBegin("user_id", TType.STRING, 3) + oprot.writeFieldBegin("user_id", TType.STRING, 2) oprot.writeString( self.user_id.encode("utf-8") if sys.version_info[0] == 2 @@ -14437,17 +14384,10 @@ def __ne__(self, other): ( 2, TType.STRING, - "owner_id", - "UTF8", - None, - ), # 2 - ( - 3, - TType.STRING, "user_id", "UTF8", None, - ), # 3 + ), # 2 ) diff --git a/docker-compose.bibigrid.yml b/docker-compose.bibigrid.yml index 5b64a9ba..7e1b183a 100644 --- a/docker-compose.bibigrid.yml +++ b/docker-compose.bibigrid.yml @@ -17,7 +17,7 @@ services: client_redis: container_name: client_redis - image: redis:7.0.1 + image: redis:7.0.2 expose: - "6379" networks: @@ -40,7 +40,7 @@ services: # filebeat filebeat: - image: docker.elastic.co/beats/filebeat:8.2.2 + image: docker.elastic.co/beats/filebeat:8.2.3 env_file: - .env volumes: diff --git a/docker-compose.dev.bibigrid.yml b/docker-compose.dev.bibigrid.yml index 9310ee84..a48557e2 100644 --- a/docker-compose.dev.bibigrid.yml +++ b/docker-compose.dev.bibigrid.yml @@ -18,7 +18,7 @@ services: client_redis: container_name: client_redis - image: redis:7.0.1 + image: redis:7.0.2 expose: - "6379" networks: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index d70a1001..70361933 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -18,7 +18,7 @@ services: client_redis: container_name: client_redis - image: redis:7.0.1 + image: redis:7.0.2 expose: - "6379" networks: diff --git a/docker-compose.yml b/docker-compose.yml index 0c3e39cf..68021b4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: client_redis: container_name: client_redis - image: redis:7.0.1 + image: redis:7.0.2 expose: - "6379" networks: @@ -26,7 +26,7 @@ services: # filebeat filebeat: container_name: client_filebeat - image: docker.elastic.co/beats/filebeat:8.2.2 + image: docker.elastic.co/beats/filebeat:8.2.3 env_file: - .env volumes: diff --git a/portal_client.thrift b/portal_client.thrift index 2654b5f0..c58235d4 100644 --- a/portal_client.thrift +++ b/portal_client.thrift @@ -545,8 +545,7 @@ service VirtualMachineService { /** Add a user to a backend*/ map add_user_to_backend( 1:i64 backend_id, - 2:string owner_id, - 3:string user_id + 2:string user_id ) /** Get users from a backend*/ @@ -557,8 +556,7 @@ service VirtualMachineService { /** Delete user from a backend*/ map delete_user_from_backend( 1:i64 backend_id, - 2:string owner_id, - 3:string user_id + 2:string user_id ) list> get_templates() diff --git a/requirements.txt b/requirements.txt index 997a6ada..4da4a1f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -setuptools==62.3.3 +setuptools==62.3.4 thrift==0.16.0 python-keystoneclient==4.5.0 openstacksdk ==0.99.0