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

(PXP-6544) Limited PFB Export from the Files Tab #729

Merged
merged 23 commits into from
Sep 8, 2020

Conversation

mpingram
Copy link
Contributor

@mpingram mpingram commented Sep 2, 2020

Link to Jira ticket: PXP-6544
Link to design doc: https://docs.google.com/document/d/12FkAYOpDuSdQScEgYBxXsPUdm8GUuUZgD6xU7EQga5A/edit#heading=h.53vab1pwrz1y
Link to relevant Pelican PR: uc-cdis/pelican#33
Link to manual test plan: uc-cdis/gen3-qa#454

Adds a limited ability to export PFBs of data files from the Files tab. The limitation is that users cannot export data files of different data types (e.g. Aligned Reads, Imaging Files, etc.). (More specifically, users cannot export data files that are on different nodes in the graph.) We're accepting this limitation in order to avoid a significant rewrite of the pelican-export job, which assumes all entities to export are on the same node.

Deployed in https://mpingram.planx-pla.net/. Please feel free to run the test plan (uc-cdis/gen3-qa#454)

New Features

  • Adds limited support for PFB Export (Download PFB / Export to Terra / Export to Seven Bridges) from the Files Tab. Users can export PFBs of data files of a single data type, but cannot export PFBs of files of multiple data types at the same time.

Breaking Changes

Bug Fixes

Improvements

  • Error messages now appear if a PFB export fails.
  • When a PFB download succeeds, shows a link to the PFB instead of just the URL of the PFB.

Dependency updates

Deployment changes

  • Limited File PFB Export requires Pelican >= 0.5.0, Tube >= 0.4.1
  • Limited File PFB Export is enabled by setting fileExplorerConfig.enableLimitedFilePFBExport: { sourceNodeField: "source_node" } and by adding buttons of buttonType export-files (Export to Terra), export-files-to-pfb (Download PFB), or export-files-to-seven-bridges (Export to Seven Bridges) to fileExplorerConfig.buttons. Example:
  "fileExplorerConfig": {
    ...
    "buttons": [
      ....
      {
        "enabled": true,
        "type": "export-files-to-pfb",
        "title": "Export All to PFB",
        "rightIcon": "external-link",
        "tooltipText": "You have not selected any cases to export. Please use the checkboxes on the left to select specific cases you would like to export."
      },
      {
        "enabled": true,
        "type": "export-files",
        "title": "Export All to Terra",
        "rightIcon": "external-link",
        "tooltipText": "You have not selected any cases to export. Please use the checkboxes on the left to select specific cases you would like to export."
      }
    ],
    "enableLimitedFilePFBExport": {"sourceNodeField": "source_node"},
  • Limited File PFB Export requires the source_node property to be ETL'd -- source_node should be added to props in the file section of etlMapping.yaml. Example:
  - name: mpingram_file
    doc_type: file
    type: collector
    root: None
    category: data_file
    props:
      - name: object_id
      - name: md5sum
      ...
      - name: source_node
  • Limited File PFB Export requires a new export-files job block to be added to the Sower config in manifest.json. The $ROOT_NODE environment variable must be set to "file", or the name of the Guppy file index if it isn't "file". For BioDataCatalyst, the EXTRA_NODES environment variable must be set to "". (This is for backwards compatibility: pelican-export includes reference_file by default on all BDCat PFB exports unless $EXTRA_NODES is set to an empty string). Example sower config:
    {
      "name": "pelican-export-files",
      "action": "export-files",
      "container": {
        "name": "job-task",
        "image": "quay.io/cdis/pelican-export:0.5.0",
        "pull_policy": "Always",
        "env": [
          {
            "name": "DICTIONARY_URL",
            "valueFrom": {
              "configMapKeyRef": {
                "name": "manifest-global",
                "key": "dictionary_url"
              }
            }
          },
          {
            "name": "GEN3_HOSTNAME",
            "valueFrom": {
              "configMapKeyRef": {
                "name": "manifest-global",
                "key": "hostname"
              }
            }
          },
          {
            "name": "ROOT_NODE",
            "value": "file"
          },
          {
            "name": "EXTRA_NODES",
            "value": ""
          }
        ],
        "volumeMounts": [
          {
            "name": "pelican-creds-volume",
            "readOnly": true,
            "mountPath": "/pelican-creds.json",
            "subPath": "config.json"
          },
          {
            "name": "peregrine-creds-volume",
            "readOnly": true,
            "mountPath": "/peregrine-creds.json",
            "subPath": "creds.json"
          }
        ],
        "cpu-limit": "1",
        "memory-limit": "4Gi"
      },
      "volumes": [
        {
          "name": "pelican-creds-volume",
          "secret": {
            "secretName": "pelicanservice-g3auto"
          }
        },
        {
          "name": "peregrine-creds-volume",
          "secret": {
            "secretName": "peregrine-creds"
          }
        }
      ],
      "restart_policy": "Never"
    },

- Reason: easier time configuring specific behavior for specific
tabs (e.g. Data and Files tab). For example, if the `export` button type
is present it triggers `refreshManifestEntryCount` behavior, which is
not needed for the files tab.
@lgtm-com
Copy link

lgtm-com bot commented Sep 2, 2020

This pull request introduces 2 alerts when merging b7099ad into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 2 alerts when merging 38ebc57 into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 3 alerts when merging 376aa8e into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update
  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 2 alerts when merging c2b7a70 into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 2 alerts when merging 1200fdc into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 2 alerts when merging 425e92a into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@lgtm-com
Copy link

lgtm-com bot commented Sep 3, 2020

This pull request introduces 2 alerts when merging 7b8c61c into 38e68f7 - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm, only 1 minor comment

if (buttonConfig.type === 'export-files-to-pfb') {
// disable the pfb export button if any other pfb export jobs are running
const otherPFBJobsRunning = this.state.exportingToTerra
|| this.state.exportingToSevenBridges;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we don't check for isPFBRunning() in here (also in export-to-pfb)?

and there are so many trios of this.state.exportingToTerra || this.state.exportingToSevenBridges || this.isPFBRunning(), maybe we should consolidate them 🤔

Copy link
Contributor Author

@mpingram mpingram Sep 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we don't check for isPFBRunning() in here (also in export-to-pfb)?

I wasn't sure why and I was scared to change it 😆. But I can't imagine how adding that extra check for isPFBRunning() would break anything, so I'll consolidate the check for this.state.exportingToTerra || this.state.exportingToSevenBridges || this.isPFBRunning() into a single function.

@lgtm-com
Copy link

lgtm-com bot commented Sep 4, 2020

This pull request introduces 2 alerts when merging fb8dd05 into 0ce11bb - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

@@ -494,9 +622,28 @@ class ExplorerButtonGroup extends React.Component {
|| this.state.exportingToSevenBridges
|| this.isPFBRunning());
}
if (buttonConfig.type === 'export-files') {
if (!this.props.buttonConfig.terraExportURL) {
console.error('Export to Terra button is present, but there is no `terraExportURL` specified in the portal config. Disabling the export to Terra button.'); // eslint-disable-line no-console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something worth noting: each re-render (like clicking a checkbox) produces this error print 12 times :O

Copy link
Contributor

@ZakirG ZakirG Sep 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's too much work, no worries, but -- the constructor might be a better place to do these error prints

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya good idea, I just stuck these checks in the constructor!

Copy link
Contributor

@ZakirG ZakirG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I tested with an unaligned reads PFB, downloaded the PFB, checked the contents, it matches what I expected. Left 2 comments heads up ~

@lgtm-com
Copy link

lgtm-com bot commented Sep 4, 2020

This pull request introduces 2 alerts when merging 49f5dd7 into 0ce11bb - view on LGTM.com

new alerts:

  • 2 for Potentially inconsistent state update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants