Skip to content

Commit

Permalink
Merge pull request #170 from NeowayLabs/addUploader
Browse files Browse the repository at this point in the history
Add uploader of blobs
  • Loading branch information
katcipis authored Apr 5, 2018
2 parents fc3bf32 + a7a04b5 commit 1f95d08
Show file tree
Hide file tree
Showing 25 changed files with 1,704 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dist: trusty
sudo: required

before_script:
- travis_wait 60 make imagedev
- travis_wait 130 make image

script:
- travis_wait 60 make test-integration logger=stdout
- travis_wait 130 make test-integration logger=stdout
42 changes: 39 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
FROM neowaylabs/klbdeps:0.4
FROM ubuntu:16.04

COPY ./aws ${NASHPATH}/lib/klb/aws
COPY ./azure ${NASHPATH}/lib/klb/azure
RUN apt-get update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
apt-get install -y nodejs=6.14.1-1nodesource1

RUN apt-get update && \
apt-get install -y \
nodejs libffi-dev openssh-server \
libffi-dev libssl-dev wget jq python-pip

RUN pip install -U pip

RUN pip install azure-cli==2.0.28 && \
pip install awscli==1.11.107 && \
npm install --no-optional -g [email protected]

ENV NASH_VERSION=v0.6
ENV NASHPATH=/root/nash
ENV NASHROOT=/root/nashroot
ENV PATH=${PATH}:${NASHROOT}/bin
RUN curl https://raw.githubusercontent.com/NeowayLabs/nash/master/hack/install/linux.sh | bash -s ${NASH_VERSION}

# Go is not required by klb itself on runtime, but having multiple
# Dockerfiles introduced space for bugs involving differences
# between the dev and final prod images. So we decided it was not
# worth to maintain two images.
ENV GO_VERSION="1.10"
ENV GOROOT="/goroot"
ENV PATH=${PATH}:${GOROOT}/bin

RUN cd /tmp && \
wget https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && \
tar -xf go$GO_VERSION.linux-amd64.tar.gz && \
mkdir -p $GOROOT && \
mv ./go/* $GOROOT

COPY ./tools/azure/createsp.sh ${NASHPATH}/bin/azure-createsp.sh
COPY ./tools/azure/getcredentials.sh ${NASHPATH}/bin/azure-getcredentials.sh

COPY ./aws ${NASHPATH}/lib/klb/aws
COPY ./azure ${NASHPATH}/lib/klb/azure

ENV PATH $PATH:${NASHPATH}/bin
28 changes: 11 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ image:
export TERMINFO=""
docker build . -t neowaylabs/klb:$(version)

imagedev: image
export TERMINFO=""
docker build . -f ./hack/Dockerfile -t neowaylabs/klbdev:$(version)

credentials: image guard-sh guard-subscription guard-service-principal guard-service-secret
docker run -ti --rm -v `pwd`:/credentials -w /credentials neowaylabs/klbdev:$(version) \
/credentials/tools/azure/getcredentials.sh \
Expand All @@ -36,7 +32,7 @@ createsp: image guard-subscription-id guard-service-principal guard-service-secr
"$(subscription-id)" "$(service-principal)" "$(service-secret)"

shell: image
./hack/run-tty.sh /usr/bin/nash
./hack/run-tty.sh nash

example-%: image
./hack/run-tty.sh ./examples/azure/$*/build.sh
Expand All @@ -55,29 +51,27 @@ install: guard-NASHPATH
@cp -pr ./tools/azure/getcredentials.sh $(bindir)/azure-credentials.sh
@cp -pr ./tools/azure/createsp.sh $(bindir)/createsp.sh

integration_timeout=50m
examples_timeout=90m
all_timeout=90m
timeout=120m
logger=file
parallel=20 #Explore I/O parallelization
cpu=10
cpu=10 # Force threads to be created
gotest=go test -v ./tests/azure -parallel $(parallel) -cpu $(cpu)
gotestargs=-args -logger $(logger)

test: imagedev
test: image
./hack/run.sh nash ./azure/vm_test.sh

test-integration: imagedev
./hack/run.sh $(gotest) -timeout $(integration_timeout) -run=$(run) ./... $(gotestargs)
test-integration: image
./hack/run.sh $(gotest) -timeout $(timeout) -run=$(run) ./... $(gotestargs)

test-examples: imagedev
./hack/run.sh $(gotest) -timeout $(examples_timeout) -tags=examples -run=TestExamples $(gotestargs)
test-examples: image
./hack/run.sh $(gotest) -timeout $(timeout) -tags=examples -run=TestExamples $(gotestargs)

# It is recommended to use this locally. It takes too much time for the CI
test-all: imagedev
./hack/run.sh $(gotest) -timeout $(all_timeout) -tags=examples $(gotestargs)
test-all: image
./hack/run.sh $(gotest) -timeout $(timeout) -tags=examples $(gotestargs)

cleanup: imagedev
cleanup: image
./hack/run-tty.sh ./tools/azure/cleanup.sh

testhost:
Expand Down
Loading

0 comments on commit 1f95d08

Please sign in to comment.