functions: 0.2.60 release [skip ci]

This commit is contained in:
Travis Reeder
2017-05-15 12:00:43 -07:00
parent 454eedd963
commit ffae780f07
18 changed files with 26 additions and 262 deletions

View File

@@ -16,9 +16,9 @@ const tmpMysql = "mysql://root:root@tcp(%v:3307)/funcs"
func prepareMysqlTest(logf, fatalf func(string, ...interface{})) (func(), func()) {
fmt.Println("initializing mysql for test")
tryRun(logf, "remove old mysql container", exec.Command("docker", "rm", "-f", "iron-mysql-test"))
tryRun(logf, "remove old mysql container", exec.Command("docker", "rm", "-f", "func-mysql-test"))
mustRun(fatalf, "start mysql container", exec.Command(
"docker", "run", "--name", "iron-mysql-test", "-p", "3307:3306", "-e", "MYSQL_DATABASE=funcs",
"docker", "run", "--name", "func-mysql-test", "-p", "3307:3306", "-e", "MYSQL_DATABASE=funcs",
"-e", "MYSQL_ROOT_PASSWORD=root", "-d", "mysql"))
maxWait := 16 * time.Second
wait := 2 * time.Second
@@ -75,7 +75,7 @@ func prepareMysqlTest(logf, fatalf func(string, ...interface{})) (func(), func()
}
},
func() {
tryRun(logf, "stop mysql container", exec.Command("docker", "rm", "-f", "iron-mysql-test"))
tryRun(logf, "stop mysql container", exec.Command("docker", "rm", "-f", "func-mysql-test"))
}
}

View File

@@ -16,8 +16,8 @@ const tmpPostgres = "postgres://postgres@%v:15432/funcs?sslmode=disable"
func preparePostgresTest(logf, fatalf func(string, ...interface{})) (func(), func()) {
fmt.Println("initializing postgres for test")
tryRun(logf, "remove old postgres container", exec.Command("docker", "rm", "-f", "iron-postgres-test"))
mustRun(fatalf, "start postgres container", exec.Command("docker", "run", "--name", "iron-postgres-test", "-p", "15432:5432", "-d", "postgres"))
tryRun(logf, "remove old postgres container", exec.Command("docker", "rm", "-f", "func-postgres-test"))
mustRun(fatalf, "start postgres container", exec.Command("docker", "run", "--name", "func-postgres-test", "-p", "15432:5432", "-d", "postgres"))
wait := 1 * time.Second
for {
@@ -50,19 +50,19 @@ func preparePostgresTest(logf, fatalf func(string, ...interface{})) (func(), fun
}
fmt.Println("postgres for test ready")
return func() {
db, err := sql.Open("postgres", fmt.Sprintf(tmpPostgres, datastoretest.GetContainerHostIP()))
if err != nil {
fatalf("failed to connect for truncation: %s\n", err)
}
for _, table := range []string{"routes", "apps", "extras"} {
_, err = db.Exec(`TRUNCATE TABLE ` + table)
db, err := sql.Open("postgres", fmt.Sprintf(tmpPostgres, datastoretest.GetContainerHostIP()))
if err != nil {
fatalf("failed to truncate table %q: %s\n", table, err)
fatalf("failed to connect for truncation: %s\n", err)
}
}
},
for _, table := range []string{"routes", "apps", "extras"} {
_, err = db.Exec(`TRUNCATE TABLE ` + table)
if err != nil {
fatalf("failed to truncate table %q: %s\n", table, err)
}
}
},
func() {
tryRun(logf, "stop postgres container", exec.Command("docker", "rm", "-f", "iron-postgres-test"))
tryRun(logf, "stop postgres container", exec.Command("docker", "rm", "-f", "func-postgres-test"))
}
}
@@ -96,4 +96,4 @@ func mustRun(fatalf func(string, ...interface{}), desc string, cmd *exec.Cmd) {
if err := cmd.Run(); err != nil {
fatalf("failed to %s: %s", desc, b.String())
}
}
}

View File

@@ -17,8 +17,8 @@ const tmpRedis = "redis://%v:6301/"
func prepareRedisTest(logf, fatalf func(string, ...interface{})) (func(), func()) {
fmt.Println("initializing redis for test")
tryRun(logf, "remove old redis container", exec.Command("docker", "rm", "-f", "iron-redis-test"))
mustRun(fatalf, "start redis container", exec.Command("docker", "run", "--name", "iron-redis-test", "-p", "6301:6379", "-d", "redis"))
tryRun(logf, "remove old redis container", exec.Command("docker", "rm", "-f", "func-redis-test"))
mustRun(fatalf, "start redis container", exec.Command("docker", "run", "--name", "func-redis-test", "-p", "6301:6379", "-d", "redis"))
timeout := time.After(20 * time.Second)
for {
@@ -41,7 +41,7 @@ func prepareRedisTest(logf, fatalf func(string, ...interface{})) (func(), func()
fmt.Println("redis for test ready")
return func() {},
func() {
tryRun(logf, "stop redis container", exec.Command("docker", "rm", "-f", "iron-redis-test"))
tryRun(logf, "stop redis container", exec.Command("docker", "rm", "-f", "func-redis-test"))
}
}

View File

@@ -1,26 +0,0 @@
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM docker:1.13.1-dind
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
COPY entrypoint.sh /usr/local/bin/
COPY dind.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# USAGE: Add a CMD to your own Dockerfile to use this (NOT an ENTRYPOINT, so that this is called)
# CMD ["./runner"]

View File

@@ -1,2 +0,0 @@
This is the base image for all Titan's docker-in-docker images.

View File

@@ -1,22 +0,0 @@
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
docker build -t iron/dind:latest .
cd go-dind
docker build -t iron/go-dind:latest .

View File

@@ -1,27 +0,0 @@
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# iron/dind-chaos
FROM docker:1.12-rc-dind
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
COPY entrypoint.sh /usr/local/bin/
COPY chaos.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# USAGE: Add a CMD to your own Dockerfile to use this (NOT an ENTRYPOINT, so that this is called)
# CMD ["./runner"]

View File

@@ -1 +0,0 @@
dind docker to periodically kill docker to test against

View File

@@ -1,31 +0,0 @@
#!/bin/sh
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
sleep 600 # 10 minutes
for i in 1..1000; do
pkill -9 dockerd
pkill -9 docker-containerd
# remove pid file since we killed docker hard
rm /var/run/docker.pid
sleep 30
docker daemon \
--host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 &
sleep 300 # 5 minutes
done

View File

@@ -1,32 +0,0 @@
#!/bin/sh
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
# modified from: https://github.com/docker-library/docker/blob/866c3fbd87e8eeed524fdf19ba2d63288ad49cd2/1.11/dind/dockerd-entrypoint.sh
# this will run either overlay or aufs as the docker fs driver, if the OS has both, overlay is preferred.
docker daemon \
--host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 &
# wait for daemon to initialize
sleep 10
/usr/local/bin/chaos.sh &
exec "$@"

View File

@@ -1,42 +0,0 @@
#!/bin/sh
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
# modified from: https://github.com/docker-library/docker/blob/866c3fbd87e8eeed524fdf19ba2d63288ad49cd2/1.11/dind/dockerd-entrypoint.sh
# this will run either overlay or aufs as the docker fs driver, if the OS has both, overlay is preferred.
# rewrite overlay to use overlay2 (docker 1.12, linux >=4.x required), see https://docs.docker.com/engine/userguide/storagedriver/selectadriver/#overlay-vs-overlay2
fsdriver=$(grep -Eh -w -m1 "overlay|aufs" /proc/filesystems | cut -f2)
if [ $fsdriver == "overlay" ]; then
fsdriver="overlay2"
fi
cmd="dockerd \
--host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 \
--storage-driver=$fsdriver"
# nanny and restart on crashes
until eval $cmd; do
echo "Docker crashed with exit code $?. Respawning.." >&2
# if we just restart it won't work, so start it (it wedges up) and
# then kill the wedgie and restart it again and ta da... yea, seriously
pidfile=/var/run/docker/libcontainerd/docker-containerd.pid
kill -9 $(cat $pidfile)
rm $pidfile
sleep 1
done

View File

@@ -1,24 +0,0 @@
#!/bin/sh
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
/usr/local/bin/dind.sh &
# wait for daemon to initialize
sleep 3
exec "$@"

View File

@@ -1,26 +0,0 @@
# Copyright 2016 Iron.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
./build.sh
docker run --rm -v "$PWD":/app treeder/bump patch
version=`cat VERSION`
echo "version $version"
docker tag iron/dind:latest iron/dind:$version
docker push iron/dind:latest
docker push iron/dind:$version

View File

@@ -1,4 +1,4 @@
package version
// Version of IronFunctions
var Version = "0.2.59"
var Version = "0.2.60"