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

Dev #504

Merged
merged 11 commits into from
Apr 18, 2024
Merged

Dev #504

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

- repo: https://github.com/psf/black-pre-commit-mirror

rev: 24.3.0
rev: 24.4.0
hooks:
- id: black
language_version: python3.11
Expand Down
4 changes: 2 additions & 2 deletions portal_client.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ service VirtualMachineService {
string get_keypair_public_key_by_name(1:string key_name)

void delete_keypair(1:string key_name)

void add_default_security_groups_to_server(1:string openstack_id) throws (1:ServerNotFoundException e)

/**
* Get a Server.
Expand Down Expand Up @@ -654,7 +654,7 @@ service VirtualMachineService {
*/
map<string,string> get_limits()

map<string,string> start_cluster(1:string public_key,2: ClusterInstance master_instance,3:list<ClusterInstance> worker_instances,4:string user)
map<string,string> start_cluster(1:list<string> public_keys,2: ClusterInstance master_instance,3:list<ClusterInstance> worker_instances,4:string user)

map<string,string> terminate_cluster(1:string cluster_id) throws(1:ClusterNotFoundException c)

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
setuptools==69.2.0
setuptools==69.5.1
thrift==0.20.0
python-keystoneclient==5.4.0
openstacksdk==3.0.0
openstacksdk==3.1.0
deprecated==1.2.14
Click==8.1.7
ansible==9.4.0
Expand All @@ -16,4 +16,4 @@ pre-commit==3.7.0
types-PyYAML==6.0.12.20240311
sympy==1.12
colorama==0.4.6
types-redis==4.6.0.20240409
types-redis==4.6.0.20240417
9 changes: 7 additions & 2 deletions simple_vm_client/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ def delete_security_group_rule(self, openstack_id):
openstack_id=openstack_id
)

def add_default_security_groups_to_server(self, openstack_id):
return self.openstack_connector.add_default_security_groups_to_server(
openstack_id=openstack_id
)

def open_port_range_for_vm_in_project(
self,
range_start,
Expand Down Expand Up @@ -462,13 +467,13 @@ def get_cluster_status(self, cluster_id: str) -> dict[str, str]:

def start_cluster(
self,
public_key: str,
public_keys: list[str],
master_instance: ClusterInstance,
worker_instances: list[ClusterInstance],
user: str,
) -> dict[str, str]:
return self.bibigrid_connector.start_cluster(
public_key=public_key,
public_keys=public_keys,
master_instance=master_instance,
worker_instances=worker_instances,
user=user,
Expand Down
15 changes: 13 additions & 2 deletions simple_vm_client/VirtualMachineService-remote
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == "--help":
print(" get_cluster_status(string cluster_id)")
print(" string get_keypair_public_key_by_name(string key_name)")
print(" void delete_keypair(string key_name)")
print(" void add_default_security_groups_to_server(string openstack_id)")
print(" VM get_server(string openstack_id)")
print(" VM get_server_by_unique_name(string unique_name)")
print(" void stop_server(string openstack_id)")
Expand All @@ -100,7 +101,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == "--help":
)
print(" get_limits()")
print(
" start_cluster(string public_key, ClusterInstance master_instance, worker_instances, string user)"
" start_cluster( public_keys, ClusterInstance master_instance, worker_instances, string user)"
)
print(" terminate_cluster(string cluster_id)")
print(" void delete_image(string image_id)")
Expand Down Expand Up @@ -688,6 +689,16 @@ elif cmd == "delete_keypair":
)
)

elif cmd == "add_default_security_groups_to_server":
if len(args) != 1:
print("add_default_security_groups_to_server requires 1 args")
sys.exit(1)
pp.pprint(
client.add_default_security_groups_to_server(
args[0],
)
)

elif cmd == "get_server":
if len(args) != 1:
print("get_server requires 1 args")
Expand Down Expand Up @@ -744,7 +755,7 @@ elif cmd == "start_cluster":
sys.exit(1)
pp.pprint(
client.start_cluster(
args[0],
eval(args[0]),
eval(args[1]),
eval(args[2]),
args[3],
Expand Down
Loading
Loading