Skip to content

Commit

Permalink
Image support (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
torosent committed Jan 8, 2019
1 parent 8b0bb20 commit 0e47661
Show file tree
Hide file tree
Showing 64 changed files with 2,350 additions and 567 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.golang.base
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ FROM ${REGISTRY}/presidio-golang-deps
WORKDIR $GOPATH/src/github.com/Microsoft/presidio
ADD . $GOPATH/src/github.com/Microsoft/presidio

RUN dep ensure && \
make go-test
RUN dep ensure
RUN make go-test
5 changes: 3 additions & 2 deletions Dockerfile.golang.deps
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM golang:1.11.3-alpine3.8

ARG DEP_VERSION="0.5.0"

RUN apk --update add curl git make g++
RUN apk --update add curl git make g++ tesseract-ocr-dev

RUN curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep && \
chmod +x $GOPATH/bin/dep && \
curl -L https://git.io/vp6lP | sh

98 changes: 65 additions & 33 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[[override]]
name = "github.com/golang/protobuf"
branch = "master"

[[constraint]]
name = "github.com/Azure/azure-event-hubs-go"
version = "1.1.0"
Expand Down Expand Up @@ -50,6 +54,10 @@
branch = "master"
name = "github.com/presid-io/stow"

[[constraint]]
name = "github.com/disintegration/imaging"
branch = "master"

[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"
Expand All @@ -73,10 +81,10 @@
[[constraint]]
name = "github.com/lib/pq"
branch = "master"

[[constraint]]
name = "google.golang.org/grpc"
version = "1.14.0"
version = "1.17.0"

[[constraint]]
name = "github.com/grpc-ecosystem/go-grpc-middleware"
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ DOCKER_REGISTRY ?= presidio.azurecr.io
DOCKER_BUILD_FLAGS :=
LDFLAGS :=

BINS = presidio-anonymizer presidio-api presidio-scheduler presidio-datasink presidio-collector
IMAGES = presidio-analyzer presidio-anonymizer presidio-api presidio-scheduler presidio-datasink presidio-collector
BINS = presidio-anonymizer presidio-ocr presidio-anonymizer-image presidio-api presidio-scheduler presidio-datasink presidio-collector
IMAGES = presidio-anonymizer presidio-ocr presidio-anonymizer-image presidio-api presidio-scheduler presidio-datasink presidio-collector presidio-analyzer
GOLANG_DEPS = presidio-golang-deps
PYTHON_DEPS = presidio-python-deps
GOLANG_BASE = presidio-golang-base
Expand Down Expand Up @@ -41,9 +41,9 @@ docker-build-base:
# DOCKER_REGISTRY to your own personal registry if you are not pushing to the official upstream.
.PHONY: docker-build
docker-build: docker-build-base
docker-build: $(addsuffix -image,$(IMAGES))
docker-build: $(addsuffix -dimage,$(IMAGES))

%-image:
%-dimage:
docker build $(DOCKER_BUILD_FLAGS) --build-arg REGISTRY=$(DOCKER_REGISTRY) --build-arg VERSION=$(VERSION) -t $(DOCKER_REGISTRY)/$*:$(PRESIDIO_LABEL) -f $*/Dockerfile .

# You must be logged into DOCKER_REGISTRY before you can push.
Expand Down Expand Up @@ -91,19 +91,26 @@ test-functional: docker-build
-docker rm test-presidio-api -f
-docker rm test-presidio-analyzer -f
-docker rm test-presidio-anonymizer -f
-docker rm test-presidio-anonymizer-image -f
-docker rm test-presidio-ocr -f

-docker network create testnetwork
docker run --rm --name test-azure-emulator --network testnetwork -e executable=blob -d -t -p 10000:10000 -p 10001:10001 -v ${HOME}/emulator:/opt/azurite/folder arafato/azurite
docker run --rm --name test-kafka -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=127.0.0.1 --env ADVERTISED_PORT=9092 spotify/kafka
docker run --rm --name test-redis --network testnetwork -d -p 6379:6379 redis
docker run --rm --name test-s3-emulator --network testnetwork -d -p 9090:9090 -p 9191:9191 -t adobe/s3mock
docker run --rm --name test-presidio-analyzer --network testnetwork -d -p 3000:3000 -e GRPC_PORT=3000 $(DOCKER_REGISTRY)/presidio-analyzer:$(PRESIDIO_LABEL)
docker run --rm --name test-presidio-anonymizer --network testnetwork -d -p 3001:3001 -e GRPC_PORT=3001 $(DOCKER_REGISTRY)/presidio-anonymizer:$(PRESIDIO_LABEL)
docker run --rm --name test-presidio-anonymizer-image --network testnetwork -d -p 3002:3002 -e GRPC_PORT=3002 $(DOCKER_REGISTRY)/presidio-anonymizer-image:$(PRESIDIO_LABEL)
docker run --rm --name test-presidio-ocr --network testnetwork -d -p 3003:3003 -e GRPC_PORT=3003 $(DOCKER_REGISTRY)/presidio-ocr:$(PRESIDIO_LABEL)
sleep 30
docker run --rm --name test-presidio-api --network testnetwork -d -p 8080:8080 -e WEB_PORT=8080 -e ANALYZER_SVC_ADDRESS=test-presidio-analyzer:3000 -e ANONYMIZER_SVC_ADDRESS=test-presidio-anonymizer:3001 $(DOCKER_REGISTRY)/presidio-api:$(PRESIDIO_LABEL)
docker run --rm --name test-presidio-api --network testnetwork -d -p 8080:8080 -e WEB_PORT=8080 -e ANALYZER_SVC_ADDRESS=test-presidio-analyzer:3000 -e ANONYMIZER_SVC_ADDRESS=test-presidio-anonymizer:3001 -e ANONYMIZER_IMAGE_SVC_ADDRESS=test-presidio-anonymizer-image:3002 -e OCR_SVC_ADDRESS=test-presidio-ocr:3003 $(DOCKER_REGISTRY)/presidio-api:$(PRESIDIO_LABEL)
go test --tags functional ./tests -count=1
docker rm test-presidio-api -f
docker rm test-presidio-analyzer -f
docker rm test-presidio-anonymizer -f
docker rm test-presidio-anonymizer-image -f
docker rm test-presidio-ocr -f
docker rm test-azure-emulator -f
docker rm test-kafka -f
docker rm test-redis -f
Expand Down
Loading

0 comments on commit 0e47661

Please sign in to comment.