Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
#319 Fix Build Process (#320)
Browse files Browse the repository at this point in the history
* Update Travis to use Ubuntu Bionic with pre-installed docker-compose

* Docker should use Ubuntu 18.04 and install git for npm

* Remove unused variables

* Add missing migration

* Fix wrong string interpolation

* Label string as RegEx
  • Loading branch information
WGierke authored and pjbull committed Dec 11, 2019
1 parent 845aace commit 13a3f88
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 22 deletions.
12 changes: 1 addition & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sudo: required
dist: bionic
git:
lfs_skip_smudge: true
env:
Expand All @@ -11,17 +12,6 @@ python: 3.6
before_install:
- echo -e "machine github.com\n login $GITHUB_TOKEN" >> ~/.netrc
- git lfs pull
- sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list'
- sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- sudo apt-get update
- sudo apt-key update
- sudo apt-get --force-yes -qqy -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
install docker-engine=17.05.0~ce-0~ubuntu-trusty
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname
-s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose -v
- docker -v
install:
Expand Down
16 changes: 13 additions & 3 deletions compose/base/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM ubuntu:rolling
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y tcl tk python3.6 python3.6-tk wget python-opencv python3-distutils
FROM ubuntu:18.04
USER root

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update

RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN python3.6 -m pip install pip --upgrade

RUN apt-get install -y tcl tk python3.6-tk wget python-opencv python3-distutils git
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3.6 get-pip.py

Expand Down
2 changes: 1 addition & 1 deletion compose/interface/Dockerfile-dev-vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:8-slim

# Install Selenium dependencies
RUN apt-get update && apt-get install -y bzip2
RUN apt-get update && apt-get install -y bzip2 git

# Install Node dependencies
COPY ./interface/frontend /app
Expand Down
2 changes: 1 addition & 1 deletion compose/interface/Dockerfile-e2e-test-vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:8-slim

# Install Selenium dependencies
RUN apt-get update && apt-get install -y bzip2
RUN apt-get update && apt-get install -y bzip2 git

# Install Node dependencies
COPY ./interface/frontend /app
Expand Down
2 changes: 1 addition & 1 deletion compose/interface/Dockerfile-unit-test-vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:8-slim

# Install Selenium dependencies
RUN apt-get update && apt-get install -y bzip2
RUN apt-get update && apt-get install -y bzip2 git

# Install Node dependencies
COPY ./interface/frontend /app
Expand Down
2 changes: 1 addition & 1 deletion interface/backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get(self, request):
path = request.GET['dicom_location']
try:
return Response(ImageFile.load_dicom_data_from_disk(path, encode_image_data=True))
except IOError as err:
except IOError:
raise NotFound(f"DICOM file not found on disk with path '{path}'")


Expand Down
4 changes: 2 additions & 2 deletions interface/backend/images/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class ImageSeriesFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.ImageSeries

patient_id = factory.Sequence(lambda n: "TEST-SERIES-{:4d}".format(n))
patient_id = factory.Sequence(lambda n: "TEST-SERIES-{:04d}".format(n))

series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.14519.5.2.1.6279.6001.{:30d}".format(n))
series_instance_uid = factory.Sequence(lambda n: "1.3.6.1.4.1.14519.5.2.1.6279.6001.{:030d}".format(n))

uri = factory.LazyAttribute(lambda f: 'file:///tmp/{}/'.format(f.series_instance_uid))

Expand Down
19 changes: 19 additions & 0 deletions interface/backend/images/migrations/0006_auto_20191205_1249.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2019-12-05 12:49
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('images', '0005_remove_imagelocation_series'),
]

operations = [
migrations.AlterModelOptions(
name='imagefile',
options={'ordering': ('slice_location',)},
),
]
2 changes: 1 addition & 1 deletion interface/backend/images/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class SmokeTest(TestCase):
def test_create_image_series(self):
image_series = ImageSeriesFactory()
self.assertRegex(image_series.series_instance_uid, '^[0-9\.]{64}')
self.assertRegex(image_series.series_instance_uid, r'^[0-9\.]{64}')
self.assertIn(image_series.series_instance_uid, image_series.uri)

def test_get_create_image_series(self):
Expand Down
2 changes: 1 addition & 1 deletion prediction/src/preprocess/lung_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def load_patient(src_dir):

try:
slice_thickness = numpy.abs(slices[0].ImagePositionPatient[2] - slices[1].ImagePositionPatient[2])
except IndexError as e:
except IndexError:
slice_thickness = numpy.abs(slices[0].SliceLocation - slices[1].SliceLocation)

for s in slices:
Expand Down

0 comments on commit 13a3f88

Please sign in to comment.