Skip to content

Commit

Permalink
Merge pull request #1 from benweissmann/bsw/mongodb-go-driver
Browse files Browse the repository at this point in the history
Upgrade to the latest MongoDB go driver and the latest version of Go
  • Loading branch information
vlasky authored Sep 13, 2021
2 parents ef8a03e + 3b4b1fd commit 70ad9b2
Show file tree
Hide file tree
Showing 71 changed files with 1,969 additions and 1,363 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.17
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ addons:

language: go
go:
- "1.12"
- "1.17"

before_install:
- docker --version
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Lint
stage: test
before_script:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0
- export PATH=$PATH:$(go env GOPATH)/bin
- golangci-lint --version
script: ./scripts/runLint.sh
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.12.9-alpine3.9
FROM golang:1.17.0-alpine3.14

# Install gcc, musl-dev, and sasl, which are needed to build the cgo
# parts of mgo
# parts of the Mongo driver
RUN apk add --no-cache --update gcc cyrus-sasl cyrus-sasl-dev musl-dev git

WORKDIR /oplogtoredis
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
FROM golang:1.12.9-alpine3.9
FROM golang:1.17.0-alpine3.14

ADD scripts/wait-for.sh /wait-for.sh

RUN apk --update --no-cache add git openssh mongodb gcc cyrus-sasl cyrus-sasl-dev musl-dev && \
RUN apk --update --no-cache add git openssh gcc cyrus-sasl cyrus-sasl-dev musl-dev && \
mkdir -p /oplogtoredis && \
go get github.com/pilu/fresh

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb=3.4.4-r0

WORKDIR /oplogtoredis

CMD fresh
2 changes: 1 addition & 1 deletion Dockerfile.integration
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# expects build context of oplogtoredis

FROM golang:1.12.9-alpine3.9 AS integration_base
FROM golang:1.17.0-alpine3.14 AS integration_base

ENV GO111MODULE on

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.racedetector
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.12.9
FROM golang:1.17.0

# This dockerfile doesn't use alpine because race detection doesn't work.
# https://github.com/golang/go/issues/14481

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# oplogtoredis

[![Build Status](https://travis-ci.org/tulip/oplogtoredis.svg?branch=master)](https://travis-ci.org/tulip/oplogtoredis)
[![Go Report Card](https://goreportcard.com/badge/github.com/tulip/oplogtoredis)](https://goreportcard.com/report/github.com/tulip/oplogtoredis)
[![GoDoc](https://godoc.org/github.com/tulip/oplogtoredis?status.svg)](http://godoc.org/github.com/tulip/oplogtoredis)
[![Go Report Card](https://goreportcard.com/badge/github.com/vlasky/oplogtoredis)](https://goreportcard.com/report/github.com/vlasky/oplogtoredis)
[![GoDoc](https://godoc.org/github.com/vlasky/oplogtoredis?status.svg)](http://godoc.org/github.com/vlasky/oplogtoredis)

This program tails the oplog of a Mongo server, and publishes changes to Redis.
It's designed to work with the [redis-oplog Meteor package](https://github.com/cult-of-coders/redis-oplog).
Expand Down Expand Up @@ -76,7 +76,7 @@ level of logging:

There are a number of other environment variables you can set to tune
various performance and reliability settings. See the
[config package docs](https://godoc.org/github.com/tulip/oplogtoredis/lib/config)
[config package docs](https://godoc.org/github.com/vlasky/oplogtoredis/lib/config)
for more details.


Expand Down Expand Up @@ -104,7 +104,7 @@ oplogtoredis uses Redis to keep track of the last message it processed. When
it starts up, it checks to see where it left off, and will resume tailing the
oplog from that timestamp, as long as it's not too far in the past (we don't
want to replay too much of the oplog, or we could could overload the
Redis or Meteor servers). The [config package docs](https://godoc.org/github.com/tulip/oplogtoredis/lib/config)
Redis or Meteor servers). The [config package docs](https://godoc.org/github.com/vlasky/oplogtoredis/lib/config)
have more detail on how to tune this behavior, but this feature should keep
your system working propertly even if every copy of oplogtoredis that you're
running goes down for a brief period.
Expand Down Expand Up @@ -156,7 +156,7 @@ The components of the docker-compose environment are:
will show you everything being published.

You can optionally also spin up 2 meteor app servers with
`docker-compose -f docker-compose.yml -f docker-compose.meteor.yml`. These
`docker-compose -f docker-compose.yml -f docker-compose.meteor.yml up`. These
servers are running a simple todos app, using redis-oplog, and pointing at the
same Mongo and Redis servers. Note that the first run will take a long time
(5-10 minutes) while Meteor does initial downloads/builds; caching makes
Expand Down
11 changes: 8 additions & 3 deletions blackbox-tests/Dockerfile.oplogtoredis-blackbox
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
FROM golang:1.12.9-alpine3.9
FROM golang:1.17.0-alpine3.14

# Install gcc, musl-dev, and sasl, which are needed to build the cgo
# parts of mgo
# parts of the Mongo driver
RUN apk add --no-cache --update \
gcc cyrus-sasl cyrus-sasl-dev musl-dev git mongodb
gcc cyrus-sasl cyrus-sasl-dev musl-dev git

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb=3.4.4-r0

WORKDIR /oplogtoredis

Expand Down
90 changes: 50 additions & 40 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
module github.com/tulip/oplogtoredis
module github.com/vlasky/oplogtoredis

go 1.12
go 1.17

require (
github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6 // indirect
github.com/alicebob/miniredis v0.0.0-20180509110325-c8ba25935377
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/deckarep/golang-set v1.7.1
github.com/globalsign/mgo v0.0.0-20180424091348-efe0945164a7
github.com/go-redis/redis v6.10.0+incompatible
github.com/go-redis/redis/v7 v7.2.0
github.com/go-redis/redis/v7 v7.4.1
github.com/gorilla/websocket v1.4.2
github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208
github.com/juju/replicaset v0.0.0-20210302050932-0303c8575745
github.com/kelseyhightower/envconfig v1.4.0
github.com/kvz/logstreamer v0.0.0-20201023134116-02d20f4338f5
github.com/kylelemons/godebug v1.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.30.0
github.com/stretchr/testify v1.7.0
go.mongodb.org/mongo-driver v1.7.2
go.uber.org/zap v1.19.0
golang.org/x/tools v0.1.5
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
)

require (
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/gomodule/redigo v2.0.0+incompatible // indirect
github.com/google/go-cmp v0.3.1 // indirect
github.com/gorilla/websocket v1.2.0
github.com/gomodule/redigo v1.8.5 // indirect
github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c // indirect
github.com/juju/errors v0.0.0-20170703010042-c7d06af17c68 // indirect
github.com/juju/loggo v0.0.0-20180327035014-7f1609ff1f3f // indirect
github.com/juju/replicaset v0.0.0-20180417123543-860376792248
github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect
github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 // indirect
github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043 // indirect
github.com/juju/version v0.0.0-20180108022336-b64dbd566305 // indirect
github.com/kelseyhightower/envconfig v1.3.0
github.com/kvz/logstreamer v0.0.0-20150507115422-a635b98146f0
github.com/kylelemons/godebug v1.1.0
github.com/matttproud/golang_protobuf_extensions v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.0.0-20180519192340-c51dc758d4bb
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5
github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1
github.com/prometheus/procfs v0.0.0-20180408092902-8b1c2da0d56d // indirect
github.com/stretchr/testify v1.4.0
github.com/tidwall/pretty v1.0.0 // indirect
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
github.com/xdg/stringprep v1.0.0 // indirect
github.com/yuin/gopher-lua v0.0.0-20180416135241-b0fa786cf4ea // indirect
go.mongodb.org/mongo-driver v1.1.1
go.uber.org/atomic v1.3.1 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.7.1
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f // indirect
github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e // indirect
github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1 // indirect
github.com/klauspost/compress v1.9.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.0.2 // indirect
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 70ad9b2

Please sign in to comment.