Skip to content

Commit

Permalink
Modify Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
winstonsmith1897 committed Aug 25, 2023
1 parent 232f158 commit 30c1230
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ADD application_manager/*.py /
ADD application_manager/get-labels.sh /

ADD run_application_manager/run_manager.sh /
ADD sifis-xacml /
#ADD services/leader_file.txt / uncomment this to test the run_manager

RUN chmod +x /run_manager.sh
Expand Down
Binary file modified application_manager/__pycache__/app_dht.cpython-310.pyc
Binary file not shown.
Binary file not shown.
9 changes: 7 additions & 2 deletions application_manager/app_dht.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ def pull_image(ws, image_name, topic_uuid, requestor_id, request_id):
topic_name = "SIFIS:application_manager_pull_image"
result = update_dht_list(ws, image_name)
if result != "Already Installed":
print("ciao")
client.images.pull(image_name)
# update_dht_list(ws, image_name)
print("pippo")
pulling_data = {
"requestor_id": requestor_id,
"request_id": request_id,
Expand Down Expand Up @@ -215,19 +217,22 @@ def remove_image(image_name, topic_uuid, request_id, requestor_id):
try:
print("[!] Removing Image : " + image_name)
topic_name = "SIFIS:application_manager_remove_image"
list_containers(topic_uuid, requestor_id, request_id, image_name)
#list_containers(topic_uuid, requestor_id, request_id, image_name)
removing_info = {
"requestor_id": requestor_id,
"request_id": request_id,
"image": image_name,
"operation": "remove image",
"result": "successfull",
}
print("prima di inviare immagine rimossa")
requests.post(
api_url + "topic_name/" + topic_name + "/topic_uuid/" + topic_uuid,
json=removing_info,
)
)
print("dopo di inviare immagine rimossa")
list_containers(topic_uuid, requestor_id, request_id, image_name)
print("dopo list")
client.images.remove(image_name, force=True)
return f"Image {image_name} removed successfully!"
except docker.errors.ImageNotFound as e:
Expand Down
1 change: 1 addition & 0 deletions application_manager/catch_topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def on_message(ws, message):
else:
print("[!] Application Manager is not registered to UC")
except Exception as e:
print("ERROR: " + str(e))
pass

if "Persistent" in json_message:
Expand Down

0 comments on commit 30c1230

Please sign in to comment.