Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
113fcda2
"...composable_kernel-1.git" did not exist on "d072790fe27a5915d12b9172020b6b74e485aadf"
Unverified
Commit
113fcda2
authored
Dec 10, 2024
by
Jakob Görgen
Browse files
symphony/runner: added runner settings file
parent
6332c6e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
symphony/runner/simbricks/runner/__main__.py
symphony/runner/simbricks/runner/__main__.py
+4
-3
symphony/runner/simbricks/runner/settings.py
symphony/runner/simbricks/runner/settings.py
+38
-0
No files found.
symphony/runner/simbricks/runner/__main__.py
View file @
113fcda2
...
@@ -30,6 +30,7 @@ from simbricks.orchestration.system import base as sys_base
...
@@ -30,6 +30,7 @@ from simbricks.orchestration.system import base as sys_base
from
simbricks.orchestration.simulation
import
base
as
sim_base
from
simbricks.orchestration.simulation
import
base
as
sim_base
from
simbricks.runtime
import
command_executor
from
simbricks.runtime
import
command_executor
from
simbricks
import
client
from
simbricks
import
client
from
.settings
import
runner_settings
as
runset
from
simbricks.utils
import
artifatcs
as
art
from
simbricks.utils
import
artifatcs
as
art
verbose
=
True
verbose
=
True
...
@@ -83,10 +84,10 @@ async def run_instantiation(sc: client.SimBricksClient, rc: client.RunnerClient,
...
@@ -83,10 +84,10 @@ async def run_instantiation(sc: client.SimBricksClient, rc: client.RunnerClient,
await
rc
.
update_run
(
run_id
,
"completed"
,
json
.
dumps
(
output
.
toJSON
()))
await
rc
.
update_run
(
run_id
,
"completed"
,
json
.
dumps
(
output
.
toJSON
()))
async
def
amain
():
async
def
amain
():
base_client
=
client
.
BaseClient
(
base_url
=
"http://172.17.0.1:8000"
)
base_client
=
client
.
BaseClient
(
base_url
=
runset
().
base_url
)
namespace_client
=
client
.
NSClient
(
base_client
=
base_client
,
namespace
=
"foo/bar/baz"
)
namespace_client
=
client
.
NSClient
(
base_client
=
base_client
,
namespace
=
runset
().
namespace
)
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
rc
=
client
.
RunnerClient
(
namespace_client
,
42
)
rc
=
client
.
RunnerClient
(
namespace_client
,
runset
().
runner_id
)
workdir
=
pathlib
.
Path
(
"./runner-work"
).
resolve
()
workdir
=
pathlib
.
Path
(
"./runner-work"
).
resolve
()
...
...
symphony/runner/simbricks/runner/settings.py
0 → 100644
View file @
113fcda2
# 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.
from
functools
import
lru_cache
from
pydantic_settings
import
BaseSettings
class
RunnerSettings
(
BaseSettings
):
base_url
:
str
=
"https://app.simbricks.io/api"
auth_client_id
:
str
=
"api.auth.simbricks.io"
auth_token_url
:
str
=
"https://auth.simbricks.io/realms/SimBricks/protocol/openid-connect/token"
auth_dev_url
:
str
=
"https://auth.simbricks.io/realms/SimBricks/protocol/openid-connect/auth/device"
namespace
:
str
=
"foo/bar/baz"
runner_id
:
int
=
42
@
lru_cache
def
runner_settings
()
->
RunnerSettings
:
return
RunnerSettings
(
_env_file
=
"runner.env"
,
_env_file_encoding
=
"utf-8"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment