Skip to content

Commit

Permalink
Merge branch 'fix/rescue_tests' of github.com:deNBI/simplevm-client i…
Browse files Browse the repository at this point in the history
…nto fix/rescue_tests
  • Loading branch information
qqmok committed Nov 21, 2024
2 parents 619450b + 176a331 commit 84f1e1d
Show file tree
Hide file tree
Showing 27 changed files with 11,652 additions and 4,073 deletions.
3 changes: 1 addition & 2 deletions docker-compose.bibigrid.host.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down Expand Up @@ -43,7 +42,7 @@ services:

simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.15.3
image: docker.elastic.co/beats/filebeat:8.16.0
network_mode: host # Use the host network namespace

env_file:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.bibigrid.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down Expand Up @@ -44,7 +43,7 @@ services:

# filebeat
simplevm_filebeat:
image: docker.elastic.co/beats/filebeat:8.15.3
image: docker.elastic.co/beats/filebeat:8.16.0
env_file:
- .env
volumes:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.dev.bibigrid.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down
1 change: 0 additions & 1 deletion docker-compose.dev.giessen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client-giessen:
container_name: simplevm-client-giessen
Expand Down
1 change: 0 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.host.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down Expand Up @@ -30,7 +29,7 @@ services:

simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.15.3
image: docker.elastic.co/beats/filebeat:8.16.0
env_file:
- .env
volumes:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
services:
simplevm-client:
container_name: simplevm-client
Expand Down Expand Up @@ -30,7 +29,7 @@ services:
# filebeat
simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.15.3
image: docker.elastic.co/beats/filebeat:8.16.0
env_file:
- .env
volumes:
Expand Down
10 changes: 6 additions & 4 deletions portal_client.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,11 @@ service VirtualMachineService {
5:optional string research_environment,
7:list<map<string,string>> volume_ids_path_new,
8:list<map<string,string>> volume_ids_path_attach,
9:optional list<string> additional_security_group_ids,
10:optional string metadata_token,
11:optional string metadata_endpoint
9:optional list<string> additional_security_group_ids,
10:optional list<string> additional_keys,
11:optional string metadata_token,
12:optional string metadata_endpoint,



) throws (1:NameAlreadyUsedException e,2:ResourceNotAvailableException r,3: ImageNotFoundException i,4: FlavorNotFoundException f,5:DefaultException d)
Expand Down Expand Up @@ -567,7 +569,7 @@ service VirtualMachineService {
/** Get boolean if client has backend url configured*/
bool has_forc()

string get_forc_url()
string get_forc_access_url()

/** Create a backend*/
Backend create_backend(
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
setuptools==75.3.0
setuptools==75.5.0
thrift==0.21.0
openstacksdk==4.0.1
deprecated==1.2.14
deprecated==1.2.15
Click==8.1.7
ansible==10.5.0
flake8==7.1.1
Expand All @@ -15,8 +15,8 @@ pre-commit==4.0.1
types-PyYAML==6.0.12.20240917
sympy==1.13.3
colorama==0.4.6
gevent==24.10.3
gevent==24.11.1
pytest==8.3.3
types-redis==4.6.0.20241004
oslo.utils==7.3.0
oslo.utils==7.4.0
passlib==1.7.4
4 changes: 2 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
roles:
- name: oefenweb.rstudio_server
version: v4.1.0
version: v5.0.0

- name: oefenweb.latest_r
version: v3.1.7
version: v3.1.10

- name: andrewrothstein.conda-env
30 changes: 19 additions & 11 deletions simple_vm_client/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def stop_server(self, openstack_id: str) -> None:
def delete_server(self, openstack_id: str) -> None:
return self.openstack_connector.delete_server(openstack_id=openstack_id)

def rescue_server(self, openstack_id: str,
admin_pass: str = None,
image_ref: str = None) -> None:
return self.openstack_connector.rescue_server(openstack_id=openstack_id,
admin_pass=admin_pass,
image_ref=image_ref)
def rescue_server(
self, openstack_id: str, admin_pass: str = None, image_ref: str = None
) -> None:
return self.openstack_connector.rescue_server(
openstack_id=openstack_id, admin_pass=admin_pass, image_ref=image_ref
)

def unrescue_server(self, openstack_id: str) -> None:
return self.openstack_connector.unrescue_server(openstack_id=openstack_id)
return self.openstack_connector.unrescue_server(openstack_id=openstack_id)

def reboot_hard_server(self, openstack_id: str) -> None:
return self.openstack_connector.reboot_hard_server(openstack_id=openstack_id)
Expand Down Expand Up @@ -207,9 +207,12 @@ def get_playbook_logs(self, openstack_id: str) -> PlaybookResult:
def has_forc(self) -> bool:
return self.forc_connector.has_forc()

def get_forc_url(self) -> str:
def get_forc_access_url(self) -> str:
return self.forc_connector.get_forc_access_url()

def get_forc_backend_url(self) -> str:
return self.forc_connector.get_forc_backend_url()

def create_snapshot(
self,
openstack_id: str,
Expand Down Expand Up @@ -429,6 +432,7 @@ def start_server_with_custom_key(
volume_ids_path_new: list[dict[str, str]],
volume_ids_path_attach: list[dict[str, str]],
additional_security_group_ids: list[str],
additional_keys: list[str],
metadata_token: str = None,
metadata_endpoint: str = None,
) -> str:
Expand All @@ -445,6 +449,7 @@ def start_server_with_custom_key(
image_name=image_name,
servername=servername,
metadata=metadata,
additional_keys=additional_keys,
research_environment_metadata=research_environment_metadata,
volume_ids_path_new=volume_ids_path_new,
volume_ids_path_attach=volume_ids_path_attach,
Expand All @@ -470,9 +475,12 @@ def create_and_deploy_playbook(
port = int(
self.openstack_connector.get_vm_ports(openstack_id=openstack_id)["port"]
)
gateway_ip = self.openstack_connector.get_gateway_ip()["gateway_ip"]
if self.openstack_connector.netcat(host=gateway_ip, port=port):
if self.openstack_connector.netcat(port=port):
cloud_site = self.openstack_connector.CLOUD_SITE
gateway_ip = self.openstack_connector.get_gateway_ip()["gateway_ip"]
internal_gateway_ip = self.openstack_connector.get_gateway_ip().get(
"internal_gateway_ip"
)
return self.forc_connector.create_and_deploy_playbook(
public_key=public_key,
research_environment_template=research_environment_template,
Expand All @@ -481,7 +489,7 @@ def create_and_deploy_playbook(
apt_packages=apt_packages,
openstack_id=openstack_id,
port=port,
ip=gateway_ip,
ip=(internal_gateway_ip if internal_gateway_ip else gateway_ip),
cloud_site=cloud_site,
base_url=base_url,
)
Expand Down
Loading

0 comments on commit 84f1e1d

Please sign in to comment.