Skip to content

Commit

Permalink
Merge pull request #157 from FAIRDataPipeline/integrate-cli
Browse files Browse the repository at this point in the history
Integrate cli
  • Loading branch information
soniamitchell authored Aug 30, 2021
2 parents fdab19d + 81482e4 commit be0a570
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 51 deletions.
53 changes: 46 additions & 7 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,66 @@ jobs:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck
extra-packages: |
rcmdcheck
remotes
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install local registry
run: /bin/bash -c "$(curl -fsSL https://data.scrc.uk/static/localregistry.sh)"
- name: Checkout FAIRDataPipeline/FAIR-CLI
uses: actions/checkout@v2
with:
repository: FAIRDataPipeline/FAIR-CLI
path: FAIR-CLI
- name: Move FAIR-CLI
run: mv FAIR-CLI ../FAIR-CLI
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install and initialise FAIR CLI
if: runner.os == 'macOS'
run: |
echo "workspace"
ls ${{ github.workspace }}
echo "above"
ls ..
cd ../FAIR-CLI
poetry install
source .venv/bin/activate
cd ${{ github.workspace }}
fair init --using mac.yaml
- name: Install and initialise FAIR CLI
if: matrix.config.os == 'ubuntu-20.04'
run: |
echo "workspace"
ls ${{ github.workspace }}
echo "above"
ls ..
cd ../FAIR-CLI
poetry install
source .venv/bin/activate
cd ${{ github.workspace }}
fair init --using ubuntu.yaml
- name: Install R API system requirements (macOS-latest)
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install hdf5
brew install gdal
shell: bash
- name: Install R API system requirements (ubuntu-20.04)
if: matrix.config.os == 'ubuntu-20.04'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
shell: bash
- name: Install local registry
run: /bin/bash -c "$(curl -fsSL https://data.scrc.uk/static/localregistry.sh)"
- name: Start registry
run: $HOME/.fair/registry/scripts/start_fair_registry
- name: Check
env:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ jobs:
- name: Start registry
run: $HOME/.fair/registry/scripts/start_fair_registry

- name: init
run: |
rDataPipeline::fair_init(
name = "Sonia Mitchell",
identifier = "https://orcid.org/0000-0003-1536-2066",
endpoint = "http://localhost:8000/api/")
shell: Rscript {0}
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export(read_array)
export(read_distribution)
export(read_estimate)
export(read_table)
export(run_server)
export(write_array)
export(write_distribution)
export(write_estimate)
Expand Down
4 changes: 0 additions & 4 deletions R/download_data_product.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#'
download_data_product <- function(data_product, version, namespace, data_dir) {

run_server()

# Where is the file -------------------------------------------------------

namespace_id <- get_entry("namespace", list(name = namespace))[[1]]$url %>%
Expand All @@ -38,8 +36,6 @@ download_data_product <- function(data_product, version, namespace, data_dir) {
object <- get_entity(object_url)
storage_location <- get_storage_location(object$storage_location)

stop_server()

# Where should we save it -------------------------------------------------

# If data_dir doesn't exist, create it
Expand Down
7 changes: 0 additions & 7 deletions R/run_server.R

This file was deleted.

5 changes: 0 additions & 5 deletions R/stop_server.R

This file was deleted.

22 changes: 22 additions & 0 deletions mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description: project
git:
local_repo: /Users/Soniam/Desktop/git/FAIRDataPipeline/rFDP
remote: origin
namespaces:
input: sonia
output: sonia
registries:
local:
data_store: /Users/runner/.fair/data/
directory: /Users/runner/.fair/registry/
uri: http://localhost:8000/api/
origin:
data_store: https://data.scrc.uk/data/
token: ${{ github.workspace }}/token.txt
uri: https://data.scrc.uk/api/
user:
email: sonia.mitchell@glasgow.ac.uk
family_name: Mitchell
given_names: Sonia
orcid: 0000-0003-1536-2066
uuid: 595638a0-fe69-4314-b108-3043b5785515
11 changes: 0 additions & 11 deletions man/run_server.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/stop_server.Rd

This file was deleted.

5 changes: 0 additions & 5 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@ library(rDataPipeline)
Sys.setenv(FDP_endpoint = "http://localhost:8000/api/")
endpoint <- Sys.getenv("FDP_endpoint")

rDataPipeline::fair_init(
name = "Sonia Mitchell",
identifier = "https://orcid.org/0000-0003-1536-2066",
endpoint = endpoint)

testthat::test_check("rDataPipeline")
1 change: 1 addition & 0 deletions token.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
58e60d4ae9521ff6373120b11679dbfebb6616f9
22 changes: 22 additions & 0 deletions ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description: project
git:
local_repo: /Users/Soniam/Desktop/git/FAIRDataPipeline/rFDP
remote: origin
namespaces:
input: sonia
output: sonia
registries:
local:
data_store: /home/runner/.fair/data/
directory: /home/runner/.fair/registry/
uri: http://localhost:8000/api/
origin:
data_store: https://data.scrc.uk/data/
token: ${{ github.workspace }}/token.txt
uri: https://data.scrc.uk/api/
user:
email: sonia.mitchell@glasgow.ac.uk
family_name: Mitchell
given_names: Sonia
orcid: 0000-0003-1536-2066
uuid: 595638a0-fe69-4314-b108-3043b5785515

0 comments on commit be0a570

Please sign in to comment.