Skip to content

Commit

Permalink
Merge branch 'edge' into chore_update-react-router-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Jul 22, 2024
2 parents ff1e62c + a6bf864 commit 9ff20a5
Show file tree
Hide file tree
Showing 184 changed files with 4,318 additions and 2,887 deletions.
77 changes: 66 additions & 11 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,45 @@ jobs:
echo "both develop builds for edge"
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-internal')) }}" = "true" ] ; then
echo "internal-release builds for app-build-internal suffixes"
elif [ "${{ format('{0}', contains(github.ref, 'app-build-internal')) }}" = "true" ] ; then
echo 'variants=["internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build')) }}" = "true" ] ; then
echo "release develop builds for app-build suffixes"
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
echo "internal-release as-release builds for app-build-internal + as-release suffixes"
echo 'type=as-release' >> $GITHUB_OUTPUT
else
echo "internal-release develop builds for app-build-internal suffixes"
echo 'type=develop' >> $GITHUB_OUTPUT
fi
elif [ "${{ format('{0}', contains(github.ref, 'app-build')) }}" = "true" ] ; then
echo 'variants=["release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-both')) }}" = "true" ] ; then
echo "Both develop builds for app-build-both suffixes"
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
echo "release as-release builds for app-build + as-release suffixes"
echo 'type=as-release' >> $GITHUB_OUTPUT
else
echo "release develop builds for app-build suffixes"
echo 'type=develop' >> $GITHUB_OUTPUT
fi
elif [ "${{ format('{0}', contains(github.ref, 'app-build-both')) }}" = "true" ] ; then
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
echo "Both as-release builds for app-build-both + as-release suffixes"
echo 'type=as-release' >> $GITHUB_OUTPUT
else
echo "Both develop builds for app-build-both + as-release suffixes"
echo 'type=develop' >> $GITHUB_OUTPUT
fi
else
echo "No build for ref ${{github.ref}} and event ${{github.event_type}}"
echo 'variants=[]' >> $GITHUB_OUTPUT
echo 'type=develop' >> $GITHUB_OUTPUT
fi
- name: set summary
run: |
echo 'Type: ${{steps.determine-build-type.outputs.type}} Variants: ${{steps.determine-build-type.outputs.variants}}' >> $GITHUB_STEP_SUMMARY
build-app:
needs: [determine-build-type]
if: needs.determine-build-type.outputs.variants != '[]'
Expand Down Expand Up @@ -278,15 +299,49 @@ jobs:
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'Configure Windows code signing environment'
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
shell: bash
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
echo "${{ secrets.WINDOWS_CSC_B64}}" | base64 --decode > /d/opentrons_labworks_inc.crt
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
- name: 'Setup Windows code signing helpers'
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
shell: cmd
env:
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}}
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}}" -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
# build the desktop app and deploy it
- name: 'build ${{matrix.variant}} app for ${{ matrix.os }}'
if: matrix.target == 'desktop'
timeout-minutes: 60
env:
OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }}
OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }}
WIN_CSC_LINK: ${{ secrets.OT_APP_CSC_WINDOWS }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_WINDOWS }}
WINDOWS_SIGN: ${{ format('{0}', contains(needs.determine-build-type.outputs.type, 'release')) }}
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 }}
CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_MACOS }}
APPLE_ID: ${{ secrets.OT_APP_APPLE_ID }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HARDWARE_DIR := hardware
USB_BRIDGE_DIR := usb-bridge
NODE_USB_BRIDGE_CLIENT_DIR := usb-bridge/node-client

PYTHON_DIRS := $(API_DIR) $(UPDATE_SERVER_DIR) $(ROBOT_SERVER_DIR) $(SERVER_UTILS_DIR) $(SHARED_DATA_DIR)/python $(G_CODE_TESTING_DIR) $(HARDWARE_DIR) $(USB_BRIDGE_DIR)
PYTHON_DIRS := $(API_DIR) $(UPDATE_SERVER_DIR) $(ROBOT_SERVER_DIR) $(SERVER_UTILS_DIR) $(SHARED_DATA_DIR)/python $(SYSTEM_SERVER_DIR) $(G_CODE_TESTING_DIR) $(HARDWARE_DIR) $(USB_BRIDGE_DIR)

# This may be set as an environment variable (and is by CI tasks that upload
# to test pypi) to add a .dev extension to the python package versions. If
Expand Down
6 changes: 4 additions & 2 deletions abr-testing/abr_testing/automation/google_sheets_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def column_letter_to_index(column_letter: str) -> int:

for col_offset, col_values in enumerate(data):
column_index = start_column_index + col_offset
# column_letter = index_to_column_letter(column_index)
for row_offset, value in enumerate(col_values):
row_index = start_row + row_offset
try:
Expand All @@ -163,7 +162,10 @@ def column_letter_to_index(column_letter: str) -> int:
)

body = {"requests": requests}
self.spread_sheet.batch_update(body=body)
try:
self.spread_sheet.batch_update(body=body)
except gspread.exceptions.APIError as e:
print(f"ERROR MESSAGE: {e}")

def update_cell(
self, sheet_title: str, row: int, column: int, single_data: Any
Expand Down
20 changes: 15 additions & 5 deletions abr-testing/abr_testing/data_collection/abr_google_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def create_data_dictionary(
"""Pull data from run files and format into a dictionary."""
runs_and_robots: List[Any] = []
runs_and_lpc: List[Dict[str, Any]] = []
headers: List[str] = []
headers_lpc: List[str] = []
for filename in os.listdir(storage_directory):
file_path = os.path.join(storage_directory, filename)
if file_path.endswith(".json"):
Expand All @@ -49,7 +51,14 @@ def create_data_dictionary(
if not isinstance(file_results, dict):
continue
run_id = file_results.get("run_id", "NaN")
try:
start_time_test = file_results["startedAt"]
completed_time_test = file_results["completedAt"]
except KeyError:
print(f"Run {run_id} is incomplete. Skipping run.")
continue
if run_id in runs_to_save:
print("started reading run.")
robot = file_results.get("robot_name")
protocol_name = file_results["protocol"]["metadata"].get("protocolName", "")
software_version = file_results.get("API_Version", "")
Expand All @@ -74,13 +83,13 @@ def create_data_dictionary(
)
try:
start_time = datetime.strptime(
file_results.get("startedAt", ""), "%Y-%m-%dT%H:%M:%S.%f%z"
start_time_test, "%Y-%m-%dT%H:%M:%S.%f%z"
)
adjusted_start_time = start_time - timedelta(hours=4)
start_date = str(adjusted_start_time.date())
start_time_str = str(adjusted_start_time).split("+")[0]
complete_time = datetime.strptime(
file_results.get("completedAt", ""), "%Y-%m-%dT%H:%M:%S.%f%z"
completed_time_test, "%Y-%m-%dT%H:%M:%S.%f%z"
)
adjusted_complete_time = complete_time - timedelta(hours=4)
complete_time_str = str(adjusted_complete_time).split("+")[0]
Expand Down Expand Up @@ -130,15 +139,16 @@ def create_data_dictionary(
**pipette_dict,
**plate_measure,
}
headers: List[str] = list(row_2.keys())
# runs_and_robots[run_id] = row_2
headers = list(row_2.keys())
runs_and_robots.append(list(row_2.values()))
# LPC Data Recording
runs_and_lpc, headers_lpc = read_robot_logs.lpc_data(
file_results, row_for_lpc, runs_and_lpc
)
else:
continue
num_of_runs_read = len(runs_and_robots)
print(f"Number of runs read: {num_of_runs_read}")
transposed_runs_and_robots = list(map(list, zip(*runs_and_robots)))
transposed_runs_and_lpc = list(map(list, zip(*runs_and_lpc)))
return transposed_runs_and_robots, headers, transposed_runs_and_lpc, headers_lpc
Expand Down Expand Up @@ -207,7 +217,6 @@ def create_data_dictionary(
start_row = google_sheet.get_index_row() + 1
print(start_row)
google_sheet.batch_update_cells(transposed_runs_and_robots, "A", start_row, "0")
# Calculate Robot Lifetimes

# Add LPC to google sheet
google_sheet_lpc = google_sheets_tool.google_sheet(credentials_path, "ABR-LPC", 0)
Expand All @@ -216,4 +225,5 @@ def create_data_dictionary(
transposed_runs_and_lpc, "A", start_row_lpc, "0"
)
robots = list(set(google_sheet.get_column(1)))
# Calculate Robot Lifetimes
sync_abr_sheet.determine_lifetime(google_sheet)
18 changes: 17 additions & 1 deletion abr-testing/abr_testing/tools/abr_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,25 @@ def get_most_recent_run_and_record(
most_recent_run_id = run_list[-1]["id"]
results = get_run_logs.get_run_data(most_recent_run_id, ip)
# Save run information to local directory as .json file
read_robot_logs.save_run_log_to_json(ip, results, storage_directory)
saved_file_path = read_robot_logs.save_run_log_to_json(
ip, results, storage_directory
)
# Check that last run is completed.
with open(saved_file_path) as file:
file_results = json.load(file)
try:
file_results["completedAt"]
except ValueError:
# no completedAt field, get run before the last run.
most_recent_run_id = run_list[-2]["id"]
results = get_run_logs.get_run_data(most_recent_run_id, ip)
# Save run information to local directory as .json file
saved_file_path = read_robot_logs.save_run_log_to_json(
ip, results, storage_directory
)
# Record run to google sheets.
print(most_recent_run_id)

(
runs_and_robots,
headers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4889,39 +4889,6 @@
},
"startedAt": "TIMESTAMP",
"status": "succeeded"
},
{
"commandType": "dispense",
"completedAt": "TIMESTAMP",
"createdAt": "TIMESTAMP",
"id": "UUID",
"key": "517162d1e8d73c035348a1870a8abc8a",
"notes": [],
"params": {
"flowRate": 160.0,
"labwareId": "UUID",
"pipetteId": "UUID",
"volume": 20.0,
"wellLocation": {
"offset": {
"x": 0.0,
"y": 0.0,
"z": -9.8
},
"origin": "top"
},
"wellName": "A2"
},
"result": {
"position": {
"x": 23.28,
"y": 181.18,
"z": 4.5
},
"volume": 20.0
},
"startedAt": "TIMESTAMP",
"status": "succeeded"
}
],
"config": {
Expand All @@ -4935,7 +4902,7 @@
"errors": [
{
"createdAt": "TIMESTAMP",
"detail": "PartialTipMovementNotAllowedError [line 26]: Error 2004 MOTION_PLANNING_FAILURE (PartialTipMovementNotAllowedError): Moving to NEST 96 Well Plate 200 µL Flat in slot A2 with A12 nozzle partial configuration will result in collision with thermocycler lid in deck slot A1.",
"detail": "PartialTipMovementNotAllowedError [line 24]: Error 2004 MOTION_PLANNING_FAILURE (PartialTipMovementNotAllowedError): Requested motion with the A12 nozzle partial configuration is outside of robot bounds for the pipette.",
"errorCode": "4000",
"errorInfo": {},
"errorType": "ExceptionInProtocolError",
Expand All @@ -4944,7 +4911,7 @@
"wrappedErrors": [
{
"createdAt": "TIMESTAMP",
"detail": "Moving to NEST 96 Well Plate 200 µL Flat in slot A2 with A12 nozzle partial configuration will result in collision with thermocycler lid in deck slot A1.",
"detail": "Requested motion with the A12 nozzle partial configuration is outside of robot bounds for the pipette.",
"errorCode": "2004",
"errorInfo": {},
"errorType": "PartialTipMovementNotAllowedError",
Expand Down
Loading

0 comments on commit 9ff20a5

Please sign in to comment.