Unverified Commit d9f47d7c authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

symphony: remove some unused files

parent 5db3e32f
MIT License
Copyright (c) 2024 - present Max Planck Institute for Software Systems, National
University of Singapore, and SimBricks contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Copyright 2024 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import argparse
import asyncio
from simbricks.utils import load_mod as utils
from simbricks import client
import sys
async def main():
parser = argparse.ArgumentParser(
prog="sim-chef",
description="CLI utility tool to send your SimBricks experiment script to the SimBricks backend for execution",
)
parser.add_argument(
"--submit-run",
metavar="SCRIPT.PY",
help="submit SimBricks expiriment python script as a run",
)
parser.add_argument(
"--check-run", metavar="RUNID", type=int, help="run id to check"
)
args = parser.parse_args()
base_client = client.BaseClient(base_url="http://0.0.0.0:8000")
namespace_client = client.NSClient(base_client=base_client, namespace="foo/bar/baz")
system_client = client.SimBricksClient(ns_client=namespace_client)
if args.submit_run:
await submit_run(system_client, args.submit_run)
elif args.check_run:
await check_run(system_client, args.check_run)
else:
print("Error: Need to specify one of the actions")
sys.exit(1)
async def submit_run(system_client: client.SimBricksClient, module_path):
experiment_mod = utils.load_module(module_path=module_path)
instantiations = experiment_mod.instantiations
sb_inst = instantiations[0]
sb_simulation = sb_inst.simulation
sb_system = sb_simulation.system
system = await system_client.create_system(sb_system)
system_id = int(system["id"])
system = await system_client.get_system(system_id)
print(system)
systems = await system_client.get_systems()
print(systems)
simulation = await system_client.create_simulation(system_id, sb_simulation)
sim_id = int(simulation["id"])
simulation = await system_client.get_simulation(sim_id)
print(simulation)
simulations = await system_client.get_simulations()
print(simulations)
instantiation = await system_client.create_instantiation(sim_id, None)
inst_id = int(instantiation["id"])
run = await system_client.create_run(inst_id)
print(run)
async def check_run(system_client, run_id):
run = await system_client.get_run(run_id)
print(run)
if __name__ == "__main__":
asyncio.run(main())
curl -X 'POST' \
'http://127.0.0.1:8000/ns/foo/bar/baz/-/systems' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia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OiJHw7ZyZ2VuIiwiZW1haWwiOiJqZ29lcmdlbkBtcGktc3dzLm9yZyJ9.s4XXSPV6uTTxO94_YMmwmcFa1BE7zwMw7B9d8Vbelgg5emfNVji0GY16huCs4gncn8tNIz0HlGgr4hm_Crwi6h8hYyEACrMIqJJRJqioWLAdIT0tsbrFbH08SeyEcsqXQ4Id_os68Mq1Cc5PMB11s9T9PXru9DjRkJ7jxfCXiyKlhIo2wERIMwEOg2QIhXayNF2FGXgjvD1LkQPMdsdx9uo4ysDiGETlyXwNoR4odYM7yipQl9SAFnAgP37ws7SshmBiUWsNdQyJQ9b_4gIxetjF4S-EJzyT1zTSqBvTk-_VECNmyj-SimCLdGQK3qjeGs_h-LPC-Lb1_rqNzuUo-Q' \
-d '{"id":1,"namespace_id":44,"json": {"system": "test"}}'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment