Skip to content

Commit

Permalink
Merge pull request IQSS#457 from IQSS/456-localstack-s3-env
Browse files Browse the repository at this point in the history
Configure s3 in the containerized environment for file upload e2e tests
  • Loading branch information
g-saracca authored Aug 21, 2024
2 parents 5832262 + 0ca4a1f commit 0933f3f
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
shell: bash

- name: Create containerized development environment .env file
working-directory: dev-env
run: cp .env.example .env
shell: bash

- name: Set S3 secrets for the containerized development environment
working-directory: dev-env
run: |
sed -i -e 's/<S3_ACCESS_KEY>/${{ secrets.S3_ACCESS_KEY }}/g' .env
sed -i -e 's/<S3_SECRET_KEY>/${{ secrets.S3_SECRET_KEY }}/g' .env
shell: bash

- name: Update registry for the containerized development environment
working-directory: dev-env
run: |
Expand Down
4 changes: 0 additions & 4 deletions dev-env/.env

This file was deleted.

6 changes: 6 additions & 0 deletions dev-env/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_VERSION=13
DATAVERSE_DB_USER=dataverse
SOLR_VERSION=9.3.0
REGISTRY=docker.io
S3_ACCESS_KEY=<S3_ACCESS_KEY>
S3_SECRET_KEY=<S3_SECRET_KEY>
1 change: 1 addition & 0 deletions dev-env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
14 changes: 14 additions & 0 deletions dev-env/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
restart: on-failure
user: payara
environment:
dataverse_files_storage__driver__id: s3
DATAVERSE_DB_HOST: postgres
DATAVERSE_DB_PASSWORD: secret
DATAVERSE_DB_USER: ${DATAVERSE_DB_USER}
Expand All @@ -54,6 +55,19 @@ services:
-Ddataverse.pid.fake.label=FakeDOIProvider
-Ddataverse.pid.fake.authority=10.5072
-Ddataverse.pid.fake.shoulder=FK2/
-Ddataverse.files.s3.access-key=${S3_ACCESS_KEY}
-Ddataverse.files.s3.label=s3
-Ddataverse.files.s3.secret-key=${S3_SECRET_KEY}
-Ddataverse.files.storage-driver-id=s3
-Ddataverse.files.s3.type=s3
-Ddataverse.files.s3.bucket-name=beta-dataverse-direct
-Ddataverse.files.s3.upload-redirect=true
-Ddataverse.files.s3.download-redirect=true
-Ddataverse.files.s3.ingestsizelimit=50000000
-Ddataverse.files.s3.url-expiration-minutes=60
-Ddataverse.files.s3.connection-pool-size=2048
-Ddataverse.files.s3.custom-endpoint-region=us-east-1
-Ddataverse.files.s3.custom-endpoint-url=https://s3.us-east-1.amazonaws.com
expose:
- '8080'
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DatasetLabels } from '../../../dataset/dataset-labels/DatasetLabels'
import { FileCardIcon } from './FileCardIcon'
import { FileType } from '../../../../files/domain/models/FileMetadata'
import { FileCardHelper } from './FileCardHelper'
import { DvObjectType } from '../../../../shared/hierarchy/domain/models/UpwardHierarchyNode'

interface FileCardHeaderProps {
filePreview: FilePreview
Expand All @@ -18,6 +19,7 @@ export function FileCardHeader({ filePreview }: FileCardHeaderProps) {
<div className={styles.title}>
<LinkToPage
page={Route.FILES}
type={DvObjectType.FILE}
searchParams={FileCardHelper.getFileSearchParams(
filePreview.id,
filePreview.datasetPublishingStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Route } from '../../../Route.enum'
import { FileChecksum } from '../../../dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileChecksum'
import { FileTabularData } from '../../../dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/FileTabularData'
import { FileCardHelper } from './FileCardHelper'
import { DvObjectType } from '../../../../shared/hierarchy/domain/models/UpwardHierarchyNode'

interface FileCardInfoProps {
filePreview: FilePreview
Expand All @@ -21,6 +22,7 @@ export function FileCardInfo({ filePreview, persistentId }: FileCardInfoProps) {
{DateHelper.toDisplayFormat(filePreview.metadata.depositDate)} -{' '}
<LinkToPage
page={Route.DATASETS}
type={DvObjectType.DATASET}
searchParams={FileCardHelper.getDatasetSearchParams(
persistentId,
filePreview.datasetPublishingStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Route } from '../../../Route.enum'
import { FileThumbnail } from '../../../dataset/dataset-files/files-table/file-info/file-info-cell/file-info-data/file-thumbnail/FileThumbnail'
import { FilePreview } from '../../../../files/domain/models/FilePreview'
import { FileCardHelper } from './FileCardHelper'
import { DvObjectType } from '../../../../shared/hierarchy/domain/models/UpwardHierarchyNode'

interface FileCardThumbnailProps {
filePreview: FilePreview
Expand All @@ -15,6 +16,7 @@ export function FileCardThumbnail({ filePreview }: FileCardThumbnailProps) {
<div className={styles.thumbnail}>
<LinkToPage
page={Route.FILES}
type={DvObjectType.FILE}
searchParams={FileCardHelper.getFileSearchParams(
filePreview.id,
filePreview.datasetPublishingStatus
Expand Down

0 comments on commit 0933f3f

Please sign in to comment.