Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulate testing #16766

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
cde88cb
increase google sheet columns
rclarke0 Jul 23, 2024
e534a8f
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 23, 2024
e200e8c
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 24, 2024
022dcb0
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 24, 2024
0cbcd1b
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 25, 2024
9628c49
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 29, 2024
9f2d693
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 30, 2024
728c2e1
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Jul 31, 2024
31d0596
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
2bbcc3e
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
916f496
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 1, 2024
ebf6c72
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 2, 2024
56aa6dd
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 6, 2024
17cadc6
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 7, 2024
378ae28
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 9, 2024
68d6778
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 9, 2024
43fcb8a
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 13, 2024
7ed3f7d
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 13, 2024
7fda077
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 14, 2024
d40b067
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 20, 2024
0f0d482
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 20, 2024
02f92cb
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 22, 2024
a50bb16
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Aug 27, 2024
20a4087
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 3, 2024
3a5d003
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 5, 2024
4b80358
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 5, 2024
7dc9204
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 9, 2024
d7ee6d4
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 10, 2024
c9dfbf6
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 16, 2024
293ba96
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 16, 2024
be60ffb
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 18, 2024
9e2d7a5
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 18, 2024
083f7e3
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 19, 2024
9b5d48b
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 23, 2024
22a4520
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 24, 2024
59779d8
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 26, 2024
f5563f0
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 27, 2024
c950b7b
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Sep 30, 2024
1842099
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 4, 2024
93f45a7
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 7, 2024
d3894d8
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 9, 2024
5704034
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 9, 2024
293803e
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 10, 2024
4c81aec
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 15, 2024
c8a29d0
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 22, 2024
adcd2a9
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 23, 2024
8bfd478
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 23, 2024
a431735
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 23, 2024
6b460db
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 24, 2024
73107de
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 24, 2024
a030bcc
Merge branch 'edge' of https://github.com/Opentrons/opentrons into edge
rclarke0 Oct 25, 2024
8f2c3ee
liquid fill protocls
rclarke0 Oct 25, 2024
30ab75d
abr protocols, removed flake complexity for protocols
rclarke0 Oct 27, 2024
4b1341b
calibration run command
rclarke0 Oct 28, 2024
04c266f
protocol drafts
rclarke0 Oct 29, 2024
f5f28b6
lint and formatting issues
rclarke0 Oct 30, 2024
bcdb656
feat(abr-testing): Added ability to simulate protocols with csv param…
AnthonyNASC20 Nov 4, 2024
7ec1162
feat(abr-testing): Added ability to simulate protocols with csv param…
AnthonyNASC20 Nov 4, 2024
197174a
fix(abr-testing): cleanup lint issues
AnthonyNASC20 Nov 5, 2024
17e7c91
feat(abr_testing): make simulate command updated to accommodate proto…
AnthonyNASC20 Nov 6, 2024
8ba70e9
abr protocols and liquid set ups
rclarke0 Nov 7, 2024
3890d70
Merge branch 'edge' into add-abr-protocols
rclarke0 Nov 7, 2024
4b5c5a3
feat(abr_tetsing): enable simulation with custom labware definitions
AnthonyNASC20 Nov 7, 2024
b50a7ca
feat(abr_tetsing): enable simulation with custom labware definitions
AnthonyNASC20 Nov 7, 2024
18124a6
fix (abr_testing): Fix for make simulate command
AnthonyNASC20 Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,28 +318,19 @@ jobs:
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
shell: cmd
env:
SM_HOST: ${{ secrets.SM_HOST_V2 }}
SM_HOST: ${{ secrets.SM_HOST }}
SM_CLIENT_CERT_FILE: "D:\\Certificate_pkcs12.p12"
SM_CLIENT_CERT_PASSWORD: ${{secrets.SM_CLIENT_CERT_PASSWORD_V2}}
SM_API_KEY: ${{secrets.SM_API_KEY_V2}}
SM_CLIENT_CERT_PASSWORD: ${{secrets.SM_CLIENT_CERT_PASSWORD}}
SM_API_KEY: ${{secrets.SM_API_KEY}}
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:${{secrets.SM_API_KEY_V2}}" -o Keylockertools-windows-x64.msi
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:${{secrets.SM_API_KEY}}" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe
smctl.exe healthcheck --all

# Do the frontend dist bundle
- name: 'bundle ${{matrix.variant}} frontend'
env:
OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }}
OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }}
OPENTRONS_PROJECT: ${{ steps.project.outputs.project }}
run: |
make -C app dist

# build the desktop app and deploy it
- name: 'build ${{matrix.variant}} app for ${{ matrix.os }}'
if: matrix.target == 'desktop'
Expand All @@ -348,14 +339,18 @@ jobs:
OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }}
OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }}
WINDOWS_SIGN: ${{ format('{0}', contains(needs.determine-build-type.outputs.type, 'release')) }}
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{secrets.SM_CODE_SIGNING_CERT_SHA1_HASH_V2}}
SM_KEYPAIR_ALIAS: ${{secrets.SM_KEYPAIR_ALIAS_V2}}
SM_HOST: ${{secrets.SM_HOST}}
SM_CLIENT_CERT_FILE: "D:\\Certificate_pkcs12.p12"
SM_CLIENT_CERT_PASSWORD: ${{secrets.SM_CLIENT_CERT_PASSWORD}}
SM_API_KEY: ${{secrets.SM_API_KEY}}
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{secrets.SM_CODE_SIGNING_CERT_SHA1_HASH}}
SM_KEYPAIR_ALIAS: ${{secrets.SM_KEYPAIR_ALIAS}}
WINDOWS_CSC_FILEPATH: "D:\\opentrons_labworks_inc.crt"
CSC_LINK: ${{ secrets.OT_APP_CSC_MACOS_V2 }}
CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_MACOS_V2 }}
APPLE_ID: ${{ secrets.OT_APP_APPLE_ID_V2 }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.OT_APP_APPLE_ID_PASSWORD_V2 }}
APPLE_TEAM_ID: ${{ secrets.OT_APP_APPLE_TEAM_ID_V2 }}
CSC_LINK: ${{ secrets.OT_APP_CSC_MACOS }}
CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_MACOS }}
APPLE_ID: ${{ secrets.OT_APP_APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.OT_APP_APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.OT_APP_APPLE_TEAM_ID }}
HOST_PYTHON: python
OPENTRONS_PROJECT: ${{ steps.project.outputs.project }}
OT_APP_DEPLOY_BUCKET: ${{ steps.project.outputs.bucket }}
Expand Down
111 changes: 93 additions & 18 deletions abr-testing/abr_testing/protocol_simulation/abr_sim_check.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,109 @@
"""Check ABR Protocols Simulate Successfully."""
from abr_testing.protocol_simulation import simulation_metrics
import os
import traceback
from pathlib import Path
from typing import Dict, List, Tuple, Union
import traceback


def run(file_to_simulate: Path) -> None:
def run(
file_dict: Dict[str, Dict[str, Union[str, Path]]], labware_defs: List[Path]
) -> None:
"""Simulate protocol and raise errors."""
protocol_name = file_to_simulate.stem
try:
simulation_metrics.main(file_to_simulate, False)
except Exception:
print(f"Error in protocol: {protocol_name}")
traceback.print_exc()
for file in file_dict:
path = file_dict[file]["path"]
csv_params = ""
try:
csv_params = str(file_dict[file]["csv"])
except KeyError:
pass
try:
print(f"Simulating {file}")
simulation_metrics.main(
protocol_file_path=Path(path),
save=False,
parameters=csv_params,
extra_files=labware_defs,
)
except Exception as e:
traceback.print_exc()
print(str(e))
print("\n")


def search(seq: str, dictionary: dict) -> str:
"""Search for specific sequence in file."""
for key in dictionary.keys():
parts = key.split("_")
if parts[0] == seq:
return key
return ""


def get_files() -> Tuple[Dict[str, Dict[str, Union[str, Path]]], List[Path]]:
"""Map protocols with corresponding csv files."""
file_dict: Dict[str, Dict[str, Union[str, Path]]] = {}
labware_defs = []
for root, directories, _ in os.walk(root_dir):
for directory in directories:
if directory == "active_protocols":
active_dir = os.path.join(root, directory)
for file in os.listdir(
active_dir
): # Iterate over files in `active_protocols`
if file.endswith(".py") and file not in exclude:
file_dict[file] = {}
file_dict[file]["path"] = Path(
os.path.abspath(
os.path.join(root_dir, os.path.join(directory, file))
)
)
if directory == "csv_parameters":
active_dir = os.path.join(root, directory)
for file in os.listdir(
active_dir
): # Iterate over files in `active_protocols`
if file.endswith(".csv") and file not in exclude:
search_str = file.split("_")[0]
protocol = search(search_str, file_dict)
if protocol:
file_dict[protocol]["csv"] = str(
os.path.abspath(
os.path.join(
root_dir, os.path.join(directory, file)
)
)
)
if directory == "custom_labware":
active_dir = os.path.join(root, directory)
for file in os.listdir(
active_dir
): # Iterate over files in `active_protocols`
if file.endswith(".json") and file not in exclude:
labware_defs.append(
Path(
os.path.abspath(
os.path.join(
root_dir, os.path.join(directory, file)
)
)
)
)
return (file_dict, labware_defs)


if __name__ == "__main__":
# Directory to search
global root_dir
root_dir = "abr_testing/protocols"

global exclude
exclude = [
"__init__.py",
"helpers.py",
"shared_vars_and_funcs.py",
"9_parameters.csv",
]
# Walk through the root directory and its subdirectories
for root, dirs, files in os.walk(root_dir):
for file in files:
if file.endswith(".py"): # If it's a Python file
if file in exclude:
continue
file_path = Path(os.path.join(root, file))
print(f"Simulating protocol: {file_path.stem}")
run(file_path)
print("Simulating Protocols")
file_dict, labware_defs = get_files()
# print(file_dict)
run(file_dict, labware_defs)
Loading
Loading