Skip to content

Commit

Permalink
Merge pull request #420 from deNBI/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
dweinholz authored Nov 7, 2023
2 parents 1927107 + 6e6209c commit 95aaeec
Show file tree
Hide file tree
Showing 17 changed files with 953 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- run: docker build --no-cache .
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected].0
uses: actions/[email protected].1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected].0
- uses: actions/[email protected].1

- name: Check Tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/[email protected].0
- uses: actions/[email protected].1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay.io
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-yaml

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/sondrelg/pep585-upgrade
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.bibigrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:

simplevm_client_redis:
container_name: simplevm_client_redis
image: redis:7.2.1
image: redis:7.2.3
expose:
- "6379"
networks:
Expand All @@ -41,7 +41,7 @@ services:

# filebeat
simplevm_filebeat:
image: docker.elastic.co/beats/filebeat:8.10.2
image: docker.elastic.co/beats/filebeat:8.10.4
env_file:
- .env
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.bibigrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:

client_redis:
container_name: simplevm_client_redis
image: redis:7.2.1
image: redis:7.2.3
expose:
- "6379"
networks:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:

client_redis:
container_name: simplevm_client_redis
image: redis:7.2.1
image: redis:7.2.3
expose:
- "6379"
networks:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:

simplevm_client_redis:
container_name: simplevm_client_redis
image: redis:7.2.1
image: redis:7.2.3
expose:
- "6379"
networks:
Expand All @@ -27,7 +27,7 @@ services:
# filebeat
simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.10.2
image: docker.elastic.co/beats/filebeat:8.10.4
env_file:
- .env
volumes:
Expand Down
11 changes: 11 additions & 0 deletions portal_client.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ exception ServerNotFoundException {
2: string name_or_id
}

exception SecurityGroupRuleNotFoundException {
/** Server not found. */
1: string message
2: string name_or_id
}

exception FlavorNotFoundException {
1: string message
Expand Down Expand Up @@ -388,6 +393,12 @@ service VirtualMachineService {

void resize_volume(1:string volume_id,2:int size) throws(1:VolumeNotFoundException v)

/**
* Creates/Updates a security group for a vm with a specific port range for a project
*/
string open_port_range_for_vm_in_project(1:int range_start,2:int range_stop,3:string openstack_id,4: string ethertype = "IPv4",5:string protocol ="TCP") throws (1:ServerNotFoundException e,2: DefaultException v,3:OpenStackConflictException o)

void delete_security_group_rule(1:string openstack_id) throws (1:SecurityGroupRuleNotFoundException e,2:DefaultException f)


/**
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ python-keystoneclient==5.2.0
openstacksdk==1.5.0
deprecated==1.2.14
Click==8.1.7
ansible==8.4.0
ansible==8.5.0
flake8==6.1.0
paramiko==2.12.0
ruamel.yaml==0.17.35
ruamel.yaml==0.18.5
pyvim==3.0.3
redis==5.0.1
requests==2.31.0
pyyaml==6.0.1
pre-commit==3.4.0
pre-commit==3.5.0
types-PyYAML==6.0.12.12
sympy==1.12
types-redis==4.6.0.7
types-redis==4.6.0.10
21 changes: 21 additions & 0 deletions simple_vm_client/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,27 @@ def delete_user_from_backend(self, backend_id: str, user_id: str) -> dict[str, s
def get_allowed_templates(self) -> list[ResearchEnvironmentTemplate]:
return self.forc_connector.template.get_allowed_templates()

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

def open_port_range_for_vm_in_project(
self,
range_start,
range_stop,
openstack_id,
ethertype: str = "IPv4",
protocol: str = "TCP",
) -> str:
return self.openstack_connector.open_port_range_for_vm_in_project(
range_start=range_start,
range_stop=range_stop,
openstack_id=openstack_id,
ethertype=ethertype,
protocol=protocol,
)

def add_udp_security_group(self, server_id: str) -> None:
return self.openstack_connector.add_udp_security_group(server_id=server_id)

Expand Down
28 changes: 28 additions & 0 deletions simple_vm_client/VirtualMachineService-remote
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ if len(sys.argv) <= 1 or sys.argv[1] == "--help":
print(" Volume get_volume(string volume_id)")
print(" get_volumes_by_ids( volume_ids)")
print(" void resize_volume(string volume_id, int size)")
print(
" string open_port_range_for_vm_in_project(int range_start, int range_stop, string openstack_id, string ethertype, string protocol)"
)
print(" void delete_security_group_rule(string openstack_id)")
print(" void delete_server(string openstack_id)")
print(
" string start_server(string flavor_name, string image_name, string public_key, string servername, metadata, volume_ids_path_new, volume_ids_path_attach, additional_keys, string research_environment, additional_security_group_ids)"
Expand Down Expand Up @@ -334,6 +338,30 @@ elif cmd == "resize_volume":
)
)

elif cmd == "open_port_range_for_vm_in_project":
if len(args) != 5:
print("open_port_range_for_vm_in_project requires 5 args")
sys.exit(1)
pp.pprint(
client.open_port_range_for_vm_in_project(
eval(args[0]),
eval(args[1]),
args[2],
args[3],
args[4],
)
)

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

elif cmd == "delete_server":
if len(args) != 1:
print("delete_server requires 1 args")
Expand Down
Loading

0 comments on commit 95aaeec

Please sign in to comment.