Skip to content

Commit

Permalink
Merge pull request #90 from datawire/remove-docker
Browse files Browse the repository at this point in the history
Remove Docker dependency.

Fixes #78.
Fixes #77.
Fixes #47.
  • Loading branch information
itamarst committed Apr 6, 2017
2 parents 7440b91 + 5e1f206 commit 6e64ca7
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 630 deletions.
21 changes: 13 additions & 8 deletions .travis.yml
@@ -1,10 +1,13 @@
dist: trusty
language: python
python:
- "2.7"
sudo: required

services:
- docker
# Run on Linux and OS X:
matrix:
include:
- os: linux
dist: trusty
- os: osx
language: generic

# Cache gcloud SDK across runs; this requires master to have builds:
cache:
Expand All @@ -18,12 +21,13 @@ env:
- CLUSTER_NAME=telepresence-testing
- CLOUDSDK_COMPUTE_ZONE=us-central1-a

# Only build master:
# Only build master branch (all PRs will be built):
branches:
only:
- master

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi
# Record some debugging info:
- python --version
- python2 --version
Expand All @@ -36,8 +40,9 @@ before_install:
- ./ci/build-torsocks.sh

install:
# Push Docker images to Google Container Registry:
- ./ci/push-images.sh
# Push Docker images to Google Container Registry; on OS X we don't bother, we
# just hope that the parallel Linux job finished building and pushing first...
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/push-images.sh; fi

script:
- make virtualenv
Expand Down
12 changes: 3 additions & 9 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: default build build-local build-remote bumpversion release local-test
.PHONY: default build-remote bumpversion release minikube-test

VERSION=$(shell git describe --tags)

Expand All @@ -11,11 +11,6 @@ default:
version:
@echo $(VERSION)

build: build-local build-remote

build-local:
cd local && docker build . -t datawire/telepresence-local:$(VERSION)

build-remote:
cd remote && docker build . -t datawire/telepresence-k8s:$(VERSION)

Expand All @@ -28,15 +23,14 @@ bumpversion: virtualenv
virtualenv/bin/bumpversion --verbose --list minor
@echo "Please run: git push origin master --tags"

local-test: virtualenv
# Run tests in minikube:
minikube-test: virtualenv
@echo "IMPORTANT: this will change kubectl context to minikube!\n\n"
cd local && sudo docker build . -q -t datawire/telepresence-local:$(VERSION)
eval $(shell minikube docker-env) && \
cd remote && \
docker build . -q -t datawire/telepresence-k8s:$(VERSION)
kubectl config set-context minikube
env TELEPRESENCE_VERSION=$(VERSION) ci/test.sh

release: build
docker push datawire/telepresence-local:$(VERSION)
docker push datawire/telepresence-k8s:$(VERSION)
19 changes: 4 additions & 15 deletions ci/push-images.sh
Expand Up @@ -4,18 +4,7 @@ set -e
export TELEPRESENCE_VERSION
TELEPRESENCE_VERSION=$(make version)

# Build local image, tag, then push to GCR:
make build-local && \
docker tag datawire/telepresence-local:${TELEPRESENCE_VERSION} \
gcr.io/${PROJECT_NAME}/telepresence-local:${TELEPRESENCE_VERSION} && \
$HOME/google-cloud-sdk/bin/gcloud docker -- push gcr.io/${PROJECT_NAME}/telepresence-local:${TELEPRESENCE_VERSION} &


# Tag Docker images with GCR tags:
make build-remote && \
docker tag datawire/telepresence-k8s:${TELEPRESENCE_VERSION} \
gcr.io/${PROJECT_NAME}/telepresence-k8s:${TELEPRESENCE_VERSION} && \
$HOME/google-cloud-sdk/bin/gcloud docker -- push gcr.io/${PROJECT_NAME}/telepresence-k8s:${TELEPRESENCE_VERSION} &

# Wait for jobs to finish
wait
make build-remote
docker tag "datawire/telepresence-k8s:${TELEPRESENCE_VERSION}" \
"gcr.io/${PROJECT_NAME}/telepresence-k8s:${TELEPRESENCE_VERSION}"
$HOME/google-cloud-sdk/bin/gcloud docker -- push "gcr.io/${PROJECT_NAME}/telepresence-k8s:${TELEPRESENCE_VERSION}"
9 changes: 5 additions & 4 deletions ci/test.sh
@@ -1,9 +1,10 @@
#!/bin/bash
set -e
virtualenv/bin/flake8 local/*.py remote/*.py cli/telepresence
virtualenv/bin/pylint -E local/entrypoint.py
# pylint doesn't work on Travis OS X, perhaps because it's python 3.6:
if [ "$(uname)" == "Linux" ]; then virtualenv/bin/pylint -E cli/telepresence; fi
cli/telepresence --version
cli/telepresence --help
[ -z "$TELEPRESENCE_TESTS" ] && export TELEPRESENCE_TESTS="tests remote/test_socks.py"
env PATH="$PWD/cli/:$PATH" virtualenv/bin/py.test \
-v -n 4 --timeout 240 --timeout-method thread --fulltrace $TELEPRESENCE_TESTS
[ -z "$TELEPRESENCE_TESTS" ] && export TELEPRESENCE_TESTS="-n 4 tests remote/test_socks.py"
env PATH="$PWD/cli/:$PATH" virtualenv/bin/py.test -v \
--timeout 360 --timeout-method thread --fulltrace $TELEPRESENCE_TESTS

0 comments on commit 6e64ca7

Please sign in to comment.