-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
307 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
from .devices import * # noqa | ||
from .tasks import * # noqa | ||
""" | ||
This is the entry point for the alab_management package. This package is used to manage the ALab project. | ||
You will need to import all the device and task definitions in the project and register them using the `add_device` | ||
and `add_task` functions. | ||
""" | ||
|
||
# import helper functions from alabos package | ||
from alab_management.device_view import add_device | ||
from alab_management.sample_view import SamplePosition, add_standalone_sample_position | ||
from alab_management.task_view import add_task | ||
|
||
# import all the device and task definitions here | ||
# relative imports are recommended (starts with a dot) | ||
from .devices.default_device import DefaultDevice | ||
from .tasks.default_task import DefaultTask | ||
|
||
# you can add the devices here. If they are the same type, | ||
# you can use the same class and just change the name. | ||
# | ||
# For example, if you have 3 devices under different IP addresses, | ||
# you can use the same class and just change the IP address and name. | ||
# AlabOS will autoamtically decide which device to run an experiment | ||
# based on their availability. | ||
add_device(DefaultDevice(name="device_1", ip_address="192.168.1.11")) | ||
add_device(DefaultDevice(name="device_2", ip_address="192.168.1.12")) | ||
add_device(DefaultDevice(name="device_3", ip_address="192.168.1.13")) | ||
|
||
# you can add all the tasks here | ||
add_task(DefaultTask) | ||
|
||
# When defining a device, you can define the sample positions related to that device, | ||
# where the sample positions are bound to the device. | ||
# AlabOS also provides a way to define standalone sample positions that are not bound to any device. | ||
add_standalone_sample_position( | ||
SamplePosition( | ||
"default_standalone_sample_position", | ||
description="Default sample position", | ||
number=8, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
[general] | ||
name = 'default_lab' | ||
working_dir = "." | ||
name = 'default_lab' # Put the name of the lab here, it will be used as the DB name | ||
working_dir = "." # the working directory of the lab, where the device and task definitions are stored | ||
|
||
[mongodb] | ||
[mongodb] # the MongoDB configuration | ||
host = 'localhost' | ||
password = '' | ||
port = 27017 | ||
username = '' | ||
|
||
# all the completed experiments are stored in this database | ||
# the db name will be the lab name + '_completed' | ||
[mongodb_completed] | ||
host = "localhost" | ||
password = "" | ||
port = 27017 | ||
username = "" | ||
|
||
[rabbitmq] | ||
[rabbitmq] # the RabbitMQ configuration | ||
host = "localhost" | ||
port = 5672 | ||
|
||
# the user notification configuration, currently only email and slack are supported | ||
# if you don't want to use them, just leave them empty | ||
[alarm] | ||
# the email configuration. All the user notification will be sent to all the email_receivers in the list | ||
# the email_sender is the email address of the sender, e.g. [email protected] | ||
email_receivers = [] | ||
email_sender = " " | ||
email_password = " " | ||
|
||
# the slack configuration. All the user notification will be sent to the slack_channel_id | ||
# the slack_bot_token is the token of the slack bot, you can get it from https://api.slack.com/apps | ||
slack_bot_token = " " | ||
slack_channel_id = " " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# from alab_management import import_device_definitions | ||
|
||
# import_device_definitions(__file__, __name__) | ||
"""You don't have to modify this file. It is used to make Python treat the directory as containing packages.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# from alab_management import import_task_definitions | ||
|
||
# import_task_definitions(__file__, __name__) | ||
"""You don't have to modify this file. It is used to make Python treat the directory as containing packages.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.