Skip to content

Commit

Permalink
Merge branch 'fix-importer-exporter-issues' into fix-duo-codes
Browse files Browse the repository at this point in the history
  • Loading branch information
vildead committed Oct 24, 2023
2 parents 1292478 + 42a50d7 commit 9e67566
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 167 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Image CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

env:
REGISTRY: ghcr.io
Expand Down
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@ FROM python:3.9.6-slim
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code/log /static \
&& apt-get update \
&& apt-get install -yq libsasl2-dev python-dev libldap2-dev git libssl-dev build-essential \
&& apt-get install -yq libsasl2-dev python-dev libldap2-dev git libssl-dev build-essential wget \
&& rm -rf /var/lib/apt/lists/*

# Install node
RUN apt-get update \
&& apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update \
&& apt-get install -y nodejs

COPY web/static /static

# Install npm dependencies
RUN cd /static/vendor \
&& npm ci \
&& npm run-script build

WORKDIR /code

# Copy the list of Python dependencies
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ You are encouraged to try Daisy for yourself using our [DEMO deployment](https:/
1. Create initial data in the database

```bash
docker-compose exec web bash -c "apt update && apt install -y wget"
docker-compose exec web bash -c "cd core/fixtures/ && wget https://git-r3lab.uni.lu/pinar.alper/metadata-tools/raw/master/metadata_tools/resources/edda.json && wget https://git-r3lab.uni.lu/pinar.alper/metadata-tools/raw/master/metadata_tools/resources/hpo.json && wget https://git-r3lab.uni.lu/pinar.alper/metadata-tools/raw/master/metadata_tools/resources/hdo.json && wget https://git-r3lab.uni.lu/pinar.alper/metadata-tools/raw/master/metadata_tools/resources/hgnc.json"
docker-compose exec web python manage.py load_initial_data
```
Expand Down
21 changes: 5 additions & 16 deletions core/fixtures/json_schemas/elu-core.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-core.json",
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-core.json",
"title": "ELIXIR Luxembourg Core json schema",
"description": "Schema containing core attributes for any json serialisable ELIXIR Luxembourg record.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"source",
"name"
],
"required": ["source", "name"],
"properties": {
"source": {
"type": "string",
Expand All @@ -20,7 +17,7 @@
"type": "string"
},
"description": {
"type": ["string", "null"]
"type": ["string", "null"]
},
"external_id": {
"type": ["string", "null"]
Expand All @@ -32,7 +29,7 @@
"type": ["string", "null"]
},
"url": {
"type": ["string", "null"]
"type": ["string", "null"]
},
"contacts": {
"type": "array",
Expand All @@ -46,7 +43,6 @@
"type": "string"
},
"role": {
"type": "string",
"enum": [
"Principal_Investigator",
"Researcher",
Expand All @@ -70,15 +66,8 @@
}
}
},
"required": [
"first_name",
"last_name",
"role",
"email",
"affiliations"
]
"required": ["first_name", "last_name", "role", "email", "affiliations"]
}
}
}
}

83 changes: 26 additions & 57 deletions core/fixtures/json_schemas/elu-dataset.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-dataset.json",
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-dataset.json",
"title": "ELIXIR Luxembourg Datasets Schema",
"description": "A JSON Schema for describing biomedical research Datasets.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-core.json"
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-core.json"
}
],
"properties": {
Expand Down Expand Up @@ -43,8 +43,8 @@
"elu:storage": {
"type": "object",
"properties": {
"platform": {"type": "string"},
"location": {"type": "string"},
"platform": { "type": "string" },
"location": { "type": "string" },
"accesses": {
"type": "array",
"items": {
Expand All @@ -56,8 +56,8 @@
"elu:transfer": {
"type": "object",
"properties": {
"partner": {"type": "string"},
"transfer_details": {"type": ["string", "null"]},
"partner": { "type": "string" },
"transfer_details": { "type": ["string", "null"] },
"transfer_date": {
"type": ["string", "null"],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
Expand All @@ -76,20 +76,12 @@
"legal_basis_codes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"6.1(a)",
"6.1(b)",
"6.1(c)",
"6.1(d)",
"6.1(e)",
"6.1(f)"
]
}},
"enum": ["6.1(a)", "6.1(b)", "6.1(c)", "6.1(d)", "6.1(e)", "6.1(f)"]
}
},
"personal_data_codes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Standard",
"Special",
Expand All @@ -107,10 +99,7 @@
"type": "string"
}
},
"required": [
"legal_basis_codes",
"personal_data_codes"
]
"required": ["legal_basis_codes", "personal_data_codes"]
},
"elu:data": {
"type": "object",
Expand All @@ -124,25 +113,24 @@
"type": "object",
"properties": {
"use_class": {
"type": "string",
"enum": [
"NRES",
"GRU(CC)",
"HMB(CC)",
"DS-[XX](CC)",
"GRU",
"HMB",
"DS",
"POA",
"RS-[XX]",
"RS",
"RUO",
"NMDS",
"GSO",
"NPU",
"PUB",
"COL-[XX]",
"COL",
"RTN",
"IRB",
"GS-[XX]",
"MOR-[XX]",
"TS-[XX]",
"GS",
"MOR",
"TS",
"US",
"PS",
"IS",
Expand All @@ -154,7 +142,6 @@
"type": "string"
},
"use_restriction_rule": {
"type": "string",
"enum": [
"OBLIGATION",
"PERMISSION",
Expand All @@ -172,16 +159,12 @@
}
}
},
"required": [
"use_class_note",
"use_restriction_rule"
]
"required": ["use_class_note", "use_restriction_rule"]
}
},
"data_types": {
"type": "array",
"items": {
"type": "string",
"enum": [
"ATAC-seq",
"Biometric_data",
Expand Down Expand Up @@ -223,34 +206,21 @@
"type": "string"
},
"access_category": {
"type": ["string", "null"],
"enum": [
"open_access",
"controlled_access",
"registered_access"
"registered_access",
null
]
},
"subjects_category": {
"type": "string",
"enum": [
"cases",
"controls",
"cases_and_controls"
]
"enum": ["cases", "controls", "cases_and_controls"]
},
"de_identification": {
"type": "string",
"enum": [
"anonymization",
"pseudonymization"
]
"enum": ["anonymization", "pseudonymization"]
},
"consent_status": {
"enum": [
"heterogeneous",
"homogeneous",
null
]
"enum": ["heterogeneous", "homogeneous", null]
},
"consent_status_description": {
"type": "string"
Expand All @@ -259,10 +229,10 @@
"type": ["boolean", "null"]
},
"special_subjects_description": {
"type": "string"
"type": ["string", "null"]
},
"embargo_date": {
"type": ["string","null"],
"type": ["string", "null"],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
},
"storage_end_date": {
Expand All @@ -276,4 +246,3 @@
}
}
}

30 changes: 10 additions & 20 deletions core/fixtures/json_schemas/elu-institution.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,36 @@
{
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-institution.json",
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-institution.json",
"title": "ELIXIR Luxembourg Partner Schema",
"description": "A JSON Schema for describing partners institutes.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [{
"$ref": "#/definitions/elu:partner"
}],
"allOf": [
{
"$ref": "#/definitions/elu:partner"
}
],
"definitions": {
"elu:partner": {
"type": "object",
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-core.json"
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-core.json"
}
],
"properties": {
"is_clinical": {
"type": "boolean"
},
"geo_category": {
"type": "string",
"enum": [
"National",
"EU",
"Non_EU",
"International"
]
"enum": ["National", "EU", "Non_EU", "International"]
},
"sector_category": {
"type": "string",
"enum": [
"PUBLIC",
"PRIVATE_P",
"PRIVATE_NP"
]
"enum": ["PUBLIC", "PRIVATE_P", "PRIVATE_NP"]
},
"address": {
"type": ["string", "null"]
},
"country_code":{
"country_code": {
"title": "ISO 3166-1 Alpha-2 Country code",
"type": ["string", "null"],
"pattern": "^[A-Z]{2}$"
Expand All @@ -48,4 +39,3 @@
}
}
}

13 changes: 7 additions & 6 deletions core/fixtures/json_schemas/elu-project.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-project.json",
"$id": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-project.json",
"title": "ELIXIR Luxembourg Projects Schema",
"description": "A JSON Schema for describing biomedical research Projects.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [{
"$ref": "#/definitions/elu:project"
}],
"allOf": [
{
"$ref": "#/definitions/elu:project"
}
],
"definitions": {
"elu:project": {
"type": "object",
"allOf": [
{
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.5/schemas/elu-study.json"
"$ref": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/v0.0.6/schemas/elu-study.json"
}
],
"properties": {
Expand All @@ -32,4 +34,3 @@
}
}
}

Loading

0 comments on commit 9e67566

Please sign in to comment.