Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ respectively. The flow ID is stored in the `flow_id` key.
You can verify deployment of the flows in the
[Globus Automate Console](https://app.globus.org/flows/library).


## Deploy the MDF Connect Service
The MDF Connect service is deployed via a GitHub action. The action is triggered
by a push to the dev or main branch. The action will deploy the service to the
Expand All @@ -87,6 +88,11 @@ of the [Data Schemas Repo](https://github.com/materials-data-facility/data-schem
The schema is deployed into the docker images used to serve up the lambda
functions.

## Reviewing Logs
- [Dev Logs](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252FMDF-Connect2-submit-dev/log-events/)
- [Prod Logs](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252FMDF-Connect2-submit-prod/log-events/)


# Running Tests
To run the tests first make sure that you are running python 3.7.10. Then install the dependencies:

Expand Down
4 changes: 2 additions & 2 deletions automate/create_new_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
mdf_flow.save_flow("mdf_flow_info.prod.json")

print("MDF Flow deployed", mdf_flow)
submitting_user_scope_id = mdf_flow.get_scope_id_for_runAs_role("SubmittingUser")[
submitting_user_scope_id = mdf_flow.get_scope_id_for_runAs_role("SubmittingUserV2")[
"scopes"
][0]["id"]
print(f"RunAs Dependent scope ID = {submitting_user_scope_id}")

submitting_user_scope_uri = mdf_flow.get_scope_uri_for_runAs_role("SubmittingUser")
submitting_user_scope_uri = mdf_flow.get_scope_uri_for_runAs_role("SubmittingUserV2")
print(
f"RunAs Dependent Scope URI (will appear in the dict of dependent scopes in the authorizer) = {submitting_user_scope_uri}"
)
Expand Down
4 changes: 2 additions & 2 deletions automate/deploy_mdf_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
]))

mdf_flow.save_flow(flow_info_file)
print("scope = ", mdf_flow.get_scope_id_for_runAs_role('SubmittingUser')['scopes'][0]['id'])
print("scope = ", mdf_flow.get_scope_id_for_runAs_role('SubmittingUserV2')['scopes'][0]['id'])

print("MDF Flow deployed", mdf_flow)
submitting_user_scope_id = mdf_flow.get_scope_id_for_runAs_role('SubmittingUser')['scopes'][0]['id']
submitting_user_scope_id = mdf_flow.get_scope_id_for_runAs_role('SubmittingUserV2')['scopes'][0]['id']

connect_scope_def = {
"scope": {
Expand Down
18 changes: 9 additions & 9 deletions automate/minimus_mdf_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def file_transfer_steps():
"CreateDatasetDir": {
"Comment": "Insure the dataset directory exists before attempting to create the version subdirectory",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/transfer/mkdir",
"ActionUrl": "https://transfer.actions.globus.org/mkdir",
"ExceptionOnActionFailure": False,
"Parameters": {
"endpoint_id.$": "$.user_transfer_inputs.destination_endpoint_id",
Expand All @@ -91,7 +91,7 @@ def file_transfer_steps():
"CreateDestinationDir": {
"Comment": "Create a destination directory for the transferred data",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/transfer/mkdir",
"ActionUrl": "https://transfer.actions.globus.org/mkdir",
"ExceptionOnActionFailure": True,
"Parameters": {
"endpoint_id.$": "$.user_transfer_inputs.destination_endpoint_id",
Expand All @@ -114,7 +114,7 @@ def file_transfer_steps():
"UserPermissions": {
"Comment": "Temporarily add write permissions for the submitting user",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/transfer/set_permission",
"ActionUrl": "https://transfer.actions.globus.org/manage_permission",
"ExceptionOnActionFailure": False,
"Parameters": {
"operation": "CREATE",
Expand All @@ -141,22 +141,22 @@ def file_transfer_steps():
"UserTransfer": {
"Comment": "Copy from user's endpoint to organization's dataset destination",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/transfer/transfer",
"ActionUrl": "https://transfer.actions.globus.org/transfer",
"WaitTime": 86400,
"RunAs": "SubmittingUser",
"RunAs": "SubmittingUserV2",
"Parameters": {
"source_endpoint_id.$": "$.user_transfer_inputs.source_endpoint_id",
"destination_endpoint_id.$": "$.user_transfer_inputs.destination_endpoint_id",
"source_endpoint.$": "$.user_transfer_inputs.source_endpoint_id",
"destination_endpoint.$": "$.user_transfer_inputs.destination_endpoint_id",
"label.$": "$.user_transfer_inputs.label",
"transfer_items.$": "$.user_transfer_inputs.transfer_items",
"DATA.$": "$.user_transfer_inputs.transfer_items",
},
"ResultPath": "$.UserTransferResult",
"Next": "UndoUserPermissions",
},
"UndoUserPermissions": {
"Comment": "Remove temporary write permissions for the submitting user",
"Type": "Action",
"ActionUrl": "https://actions.globus.org/transfer/set_permission",
"ActionUrl": "https://transfer.actions.globus.org/manage_permission",
"ExceptionOnActionFailure": False,
"Parameters": {
"operation": "DELETE",
Expand Down
2 changes: 1 addition & 1 deletion aws/automate_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def submit(self, mdf_rec, organization,
"datacite_prefix": self.datacite_prefix,
"datacite_as_test": is_test,
"_tokens": {
'SubmittingUser': submitting_user_token['access_token']
'SubmittingUserV2': submitting_user_token['access_token']
}
}

Expand Down
6 changes: 3 additions & 3 deletions aws/tests/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pytest<8.0
pytest-mock
pytest-bdd==4.1.0
git+https://github.com/materials-data-facility/connect_client.git@v0.4.0-dev
pytest-bdd
mdf-connect-client
jsonschema>=2.6.0
boto3
boto3
Loading