-
Notifications
You must be signed in to change notification settings - Fork 17
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
110 changed files
with
5,523 additions
and
1,749 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Sync GitHub issues to Jira | ||
on: [issues, issue_comment] | ||
|
||
jobs: | ||
sync-issues: | ||
name: Sync issues to Jira | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: canonical/sync-issues-github-jira@v1 | ||
with: | ||
webhook-url: ${{ secrets.JIRA_WEBHOOK_URL }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.7.0 | ||
2.8.0 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright 2023 Zurich Instruments AG | ||
# SPDX-License-Identifier: Apache-2.0 |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright 2023 Zurich Instruments AG | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import logging | ||
from dataclasses import dataclass | ||
|
||
from lagom import Container, Singleton | ||
|
||
from laboneq.implementation.compilation_service.compilation_service_legacy import ( | ||
CompilationServiceLegacy, | ||
) | ||
from laboneq.implementation.experiment_workflow import ExperimentWorkflow | ||
from laboneq.implementation.payload_builder.payload_builder import PayloadBuilder | ||
from laboneq.implementation.runner.runner_legacy import RunnerLegacy | ||
from laboneq.interfaces.application_management.laboneq_settings import LabOneQSettings | ||
from laboneq.interfaces.compilation_service.compilation_service_api import ( | ||
CompilationServiceAPI, | ||
) | ||
from laboneq.interfaces.experiment.experiment_api import ExperimentAPI | ||
from laboneq.interfaces.payload_builder.payload_builder_api import PayloadBuilderAPI | ||
from laboneq.interfaces.runner.runner_api import RunnerAPI | ||
from laboneq.interfaces.runner.runner_control_api import RunnerControlAPI | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
@dataclass(init=False) | ||
class LaboneQDefaultSettings(LabOneQSettings): | ||
def __init__(self): | ||
self.runner_is_local = True | ||
self.compilation_service_is_local = True | ||
|
||
# TODO: use a configration file or environment variables to set these values | ||
# Maybe use dotenv (see https://pypi.org/project/python-dotenv/) | ||
# and/or dynaconf (see https://www.dynaconf.com/) | ||
runner_is_local: bool | ||
compilation_service_is_local: bool | ||
|
||
|
||
class ApplicationManager: | ||
_instance = None | ||
|
||
def __init__(self): | ||
self._experimenter_api = None | ||
|
||
def start(self): | ||
if self._experimenter_api is not None: | ||
_logger.warning("ApplicationManager already started.") | ||
return | ||
container = Container(log_undefined_deps=True) | ||
container[LabOneQSettings] = LaboneQDefaultSettings | ||
container[RunnerControlAPI] = Singleton(RunnerLegacy) | ||
# RunnerControlAPI and the RunnerAPI are currently implemented by the same object: | ||
container[RunnerAPI] = container[RunnerControlAPI] | ||
container[CompilationServiceAPI] = CompilationServiceLegacy | ||
container[PayloadBuilderAPI] = PayloadBuilder | ||
container[ExperimentAPI] = ExperimentWorkflow | ||
self._experimenter_api = container[ExperimentAPI] | ||
|
||
def laboneq(self) -> ExperimentAPI: | ||
return self._experimenter_api | ||
|
||
@staticmethod | ||
def instance() -> "ApplicationManager": | ||
if ApplicationManager._instance is None: | ||
ApplicationManager._instance = ApplicationManager() | ||
ApplicationManager._instance.start() | ||
return ApplicationManager._instance |
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.