Skip to content

Commit a362c0d

Browse files
committed
Add GDC client (resolves #274)
1 parent 1c72c33 commit a362c0d

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

gdc-client/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:14.04
2+
3+
MAINTAINER "John Vivian"
4+
5+
LABEL version="1.2.0" \
6+
mode="gdc-client-1.2.0" \
7+
description="docker image to run NCI gdc-client"
8+
9+
# Install GDC-Client
10+
RUN apt-get update
11+
RUN apt-get install -y wget zip unzip
12+
RUN cd /opt && wget https://gdc.cancer.gov/files/public/file/gdc-client_v1.2.0_Ubuntu14.04_x64.zip && unzip gdc-client_v1.2.0_Ubuntu14.04_x64.zip
13+
RUN cp /opt/gdc-client /usr/local/bin/
14+
15+
# Data dir
16+
RUN mkdir /data
17+
WORKDIR /data
18+
19+
# Set ENTRYPOINT
20+
ENTRYPOINT ["/usr/local/bin/gdc-client"]
21+
CMD ["-h"]

gdc-client/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Definitions
2+
build_output = runtime/gdc-client
3+
runtime_fullpath = $(realpath runtime)
4+
build_tool = runtime-container.DONE
5+
git_commit ?= $(shell git log --pretty=oneline -n 1 -- ../gdc-client| cut -f1 -d " ")
6+
name = quay.io/ucsc_cgl/gdc-client
7+
tag = 1.2--${git_commit}
8+
9+
# Steps
10+
build:
11+
docker build -t ${name}:${tag} .
12+
-docker rmi -f ${name}:latest
13+
docker tag ${name}:${tag} ${name}:latest
14+
touch ${build_tool}
15+
16+
push: build
17+
# Requires ~/.dockercfg
18+
docker push ${name}:${tag}
19+
docker push ${name}:latest
20+
21+
test: build
22+
python test.py
23+
24+
clean:
25+
-rm ${build_tool}
26+
-rm ${build_output}

gdc-client/test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python2.7
2+
# John Vivian
3+
import subprocess
4+
import unittest
5+
6+
7+
class TestGDC(unittest.TestCase):
8+
def test_docker_call(self):
9+
out, err = check_docker_output(tool='quay.io/ucsc_cgl/gdc-client')
10+
self.assertTrue('Genomic Data Common' in out)
11+
12+
13+
def check_docker_output(tool):
14+
command = 'docker run ' + tool
15+
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
16+
output = process.communicate()
17+
return output
18+
19+
20+
if __name__ == '__main__':
21+
unittest.main()

0 commit comments

Comments
 (0)