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

enable previewers in containers #10506

Open
pdurbin opened this issue Apr 18, 2024 · 4 comments · May be fixed by #11181
Open

enable previewers in containers #10506

pdurbin opened this issue Apr 18, 2024 · 4 comments · May be fixed by #11181
Labels
Component: Containers Anything related to cloudy Dataverse, shipped in containers. Size: 30 A percentage of a sprint. 21 hours. (formerly size:33)

Comments

@pdurbin
Copy link
Member

pdurbin commented Apr 18, 2024

In today's Containerization Working Group meeting (recording, notes) I explained that I would like to have file previewers in our containerized dev and demo environments.

(I want other things too such as language packs and CVOC scripts but previewers feels like a good place to start.)

There were several suggestions of how to accomplish this, but I said I'd start with the simplest one, which is to use the previewers hosted on GitHub Pages. Unfortunately, this doesn't work, due to CORS.

This is the URL I'm using to try to preview the file: http://localhost:8080/file.xhtml?fileId=18&version=DRAFT&toolType=PREVIEW

Here's the curl command I used from https://github.com/gdcc/dataverse-previewers/blob/1.4/6.1curlcommands.md

curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
  "displayName":"Read Text",
  "description":"Read the text file.",
  "toolName":"textPreviewer",
  "scope":"file",
  "types":["preview"],
  "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/TextPreview.html",
  "toolParameters": {
      "queryParameters":[
        {"fileid":"{fileId}"},
        {"siteUrl":"{siteUrl}"},
        {"datasetid":"{datasetId}"},
        {"datasetversion":"{datasetVersion}"},
        {"locale":"{localeCode}"}
      ]
    },
  "contentType":"text/plain",
  "allowedApiCalls": [
    {
      "name": "retrieveFileContents",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true",
      "timeOut": 3600
    },
    {
      "name": "downloadFile",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false",
      "timeOut": 3600
    },
    {
      "name": "getDatasetVersionMetadata",
      "httpMethod": "GET",
      "urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}",
      "timeOut": 3600
    }
  ]
}'

Here's the CORS error:

Image

Image

We'll need to determine what to try next. Possible solutions:

  • Put the files in /dv/docroot/dataexplore or similar, a directory where Payara serves static files
  • Put the files in a Docker container

Related discussion:

@pdurbin pdurbin converted this from a draft issue Apr 18, 2024
@pdurbin pdurbin added the Component: Containers Anything related to cloudy Dataverse, shipped in containers. label Apr 18, 2024
@pdurbin
Copy link
Member Author

pdurbin commented Oct 31, 2024

Should we consider enabling all previewers? And let people delete the ones they don't want?

dataverse-ansible already installs some previewers. Can we share a script between ansible and our Docker images?

https://github.com/gdcc/dataverse-previewers/blob/develop/6.1curlcommands.md is fine as a README but it feels a bit weird to copy each curl command into a script.

@pdurbin
Copy link
Member Author

pdurbin commented Nov 15, 2024

@pdurbin
Copy link
Member Author

pdurbin commented Nov 15, 2024

@pdurbin
Copy link
Member Author

pdurbin commented Jan 16, 2025

In scope:

size: 20 (10 or 30)

Stretch goals:

  • move everything under gdcc (design doc?)

size: TBD

Future:

@pdurbin pdurbin added the Size: 30 A percentage of a sprint. 21 hours. (formerly size:33) label Jan 16, 2025
@cmbz cmbz moved this to SPRINT READY in IQSS Dataverse Project Jan 16, 2025
@pdurbin pdurbin linked a pull request Jan 23, 2025 that will close this issue
pdurbin added a commit that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Containers Anything related to cloudy Dataverse, shipped in containers. Size: 30 A percentage of a sprint. 21 hours. (formerly size:33)
Projects
Status: SPRINT READY
Development

Successfully merging a pull request may close this issue.

1 participant