Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #219 from jdeathe/centos-7-develop
Browse files Browse the repository at this point in the history
Release changes for 2.4.1
  • Loading branch information
jdeathe authored Oct 8, 2019
2 parents 1e31cf3 + e28d481 commit d8d56b1
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 98 deletions.
24 changes: 12 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.env
.env.example
.git
.gitignore
dist
test
var
docker-compose.yml
LICENSE
README-short.txt
*.md
/.env
/.env.example
/.git
/.gitignore
/dist
/docs
/test
/docker-compose.yml
/LICENSE
/README-short.txt
/*.md
!README.md
**/*.mk
**/Makefile
**/Makefile
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.env
dist
/.env
/dist
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@

Summary of release changes.

### 2.4.1 - 2019-10-08

- Deprecate Makefile target `logs-delayed`; replaced with `logsdef`.
- Updates Varnish to [6.2.1](https://github.com/varnishcache/varnish-cache/blob/varnish-6.2.1/doc/changes.rst).
- Updates `gcc` package to 4.8.5-39.
- Updates startsecs for `varnishncsa-wrapper` to 5 seconds.
- Updates `test/health_status` helper script with for consistency.
- Updates Makefile target `logs` to accept `[OPTIONS]` (e.g `make -- logs -ft`).
- Updates info/error output for consistency.
- Updates healthcheck failure messages to remove EOL character that is rendered in status response.
- Updates ordering of Tags and respective Dockerfile links in README.md for readability.
- Adds improved test workflow; added `test-setup` target to Makefile.
- Adds Makefile target `logsdef` to handle deferred logs output within a target chain.
- Adds `/docs` directory for supplementary documentation and simplify README.
- Fixes validation failure of 0 second --timeout value in `test/health_status`.

### 2.4.0 - 2019-08-17

- Updates source image to [2.6.0](https://github.com/jdeathe/centos-ssh/releases/tag/2.6.0).
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM jdeathe/centos-ssh:2.6.0
FROM jdeathe/centos-ssh:2.6.1

ARG RELEASE_VERSION="2.4.0"
ARG RELEASE_VERSION="2.4.1"

# ------------------------------------------------------------------------------
# Base install of required packages
Expand All @@ -21,8 +21,8 @@ RUN { printf -- \
&& yum -y install \
--setopt=tsflags=nodocs \
--disableplugin=fastestmirror \
gcc-4.8.5-36.el7_6.1 \
varnish-6.2.0-1.el7 \
gcc-4.8.5-39.el7 \
varnish-6.2.1-1.el7 \
&& yum versionlock add \
varnish \
gcc \
Expand Down
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Targets:
images Show container's image details.
load Loads from the distribution package. Requires
DOCKER_IMAGE_TAG variable.
logs Display log output from the running container.
logs-delayed Display log output from the running container after
backing off for STARTUP_TIME seconds. This can be
necessary when chaining make targets together.
logs [OPTIONS] Display log output from the container.
logsdef Display log output from the container deferred for
STARTUP_TIME seconds. This will work in a chain
unlike the logs target.
logs-delayed [DEPRECATED] Replaced with logsdef.
pause Pause the running container.
pull Pull the release image from the registry. Requires
the DOCKER_IMAGE_TAG variable.
Expand All @@ -45,6 +46,7 @@ Targets:
stop Stop the container when in a running state.
terminate Unpause, stop and remove the container.
test Run all test cases.
test-setup Install test dependencies.
top [ps OPTIONS] Display the running processes of the container.
unpause Unpause the container when in a paused state.

Expand Down Expand Up @@ -161,6 +163,7 @@ endef
_require-docker-image-tag \
_require-docker-release-tag \
_require-package-path \
_require-root \
_test-prerequisites \
_usage \
all \
Expand All @@ -176,6 +179,7 @@ endef
images \
load \
logs \
logsdef \
logs-delayed \
pause \
pull \
Expand All @@ -191,6 +195,7 @@ endef
stop \
terminate \
test \
test-setup \
top \
unpause

Expand Down Expand Up @@ -365,9 +370,17 @@ _require-package-path:
exit 1; \
fi

_require-root:
@ if [[ $${EUID} -ne 0 ]]; \
then \
>&2 printf -- '%sMust be run as root\n' \
"$(PREFIX_STEP_NEGATIVE)"; \
exit 1; \
fi

_test-prerequisites:
ifeq ($(shpec),)
$(error "Please install shpec.")
$(error "Please install shpec. Try: DOCKER_NAME=$(DOCKER_NAME) make test-setup")
endif

_usage:
Expand Down Expand Up @@ -581,14 +594,20 @@ install: | \
logs: \
_prerequisites \
_require-docker-container
@ $(docker) logs $(DOCKER_NAME)
@ $(docker) logs \
$(filter-out $@, $(MAKECMDGOALS)) \
$(DOCKER_NAME)
%:; @:

logs-delayed: \
logsdef: \
_prerequisites \
_require-docker-container
@ sleep $(STARTUP_TIME)
@ $(MAKE) logs

logs-delayed: \
logsdef

load: \
_prerequisites \
_require-docker-release-tag \
Expand Down Expand Up @@ -980,6 +999,18 @@ test: \
"Functional test"
@ SHPEC_ROOT=$(SHPEC_ROOT) $(shpec)

test-setup: \
_require-root
@ printf -- '%s%s\n' \
"$(PREFIX_STEP)" \
"Installing shpec"
@ bash -c "$$(curl -LSs \
https://raw.githubusercontent.com/rylnd/shpec/master/install.sh \
)"
@ ln -sf \
/usr/local/bin/shpec \
/usr/bin/shpec

unpause: \
_prerequisites \
_require-docker-container \
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Tags and respective `Dockerfile` links

- `centos-7`, `2.4.0` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-varnish/blob/centos-7/Dockerfile)
- `centos-6`, `1.7.0` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-varnish/blob/centos-6/Dockerfile)
- [`2.4.1`](https://github.com/jdeathe/centos-ssh-varnish/releases/tag/2.4.1), `centos-7` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-varnish/blob/centos-7/Dockerfile)
- [`1.7.1`](https://github.com/jdeathe/centos-ssh-varnish/releases/tag/1.7.1), `centos-6` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-varnish/blob/centos-6/Dockerfile)

## Overview

Expand All @@ -26,7 +26,7 @@ $ docker run -d -t \
-p 80:80 \
--sysctl "net.core.somaxconn=1024" \
--add-host httpd_1:172.17.8.101 \
jdeathe/centos-ssh-varnish:2.4.0
jdeathe/centos-ssh-varnish:2.4.1
```

Verify the named container's process status and health.
Expand Down Expand Up @@ -73,7 +73,7 @@ $ docker stop varnish.1 && \
--env "VARNISH_MAX_THREADS=2000" \
--env "VARNISH_MIN_THREADS=100" \
--add-host httpd_1:172.17.8.101 \
jdeathe/centos-ssh-varnish:2.4.0
jdeathe/centos-ssh-varnish:2.4.1
```

#### Environment variables
Expand Down
13 changes: 13 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Testing

## Functional

The functional test cases are written in [shpec](https://github.com/rylnd/shpec).

To run the tests use the `test` Makefile target after building.

> *Note:* You might need to run via sudo if your environment requires root privileges to run docker.
```
$ make build test
```
2 changes: 1 addition & 1 deletion src/etc/supervisord.d/50-varnishncsa-wrapper.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ autostart = %(ENV_ENABLE_VARNISHNCSA_WRAPPER)s
command = /usr/sbin/varnishncsa-wrapper --verbose
priority = 50
startretries = 0
startsecs = 4
startsecs = 5
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/stdout
Expand Down
20 changes: 10 additions & 10 deletions src/usr/bin/healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ function main ()
| grep -qE '^/usr/bin/python /usr/bin/supervisord'
then
>&2 printf -- \
'%s\n' \
"supervisord not running."
'%s' \
"supervisord not running"
exit 1
fi

if [[ ${system_timezone} != "${zone}" ]]
then
>&2 printf -- \
'%s\n' \
"system-timezone zone mismatch."
'%s' \
"system-timezone zone mismatch"
exit 1
fi

Expand All @@ -71,8 +71,8 @@ function main ()
| grep -qE '^/usr/sbin/varnishd '
then
>&2 printf -- \
'%s\n' \
"varnishd not running."
'%s' \
"varnishd not running"
exit 1
fi

Expand All @@ -81,8 +81,8 @@ function main ()
&> /dev/null
then
>&2 printf -- \
'%s\n' \
"varnishd not booted."
'%s' \
"varnishd not booted"
exit 1
fi

Expand All @@ -91,8 +91,8 @@ function main ()
| grep -qE '^/usr/bin/varnishncsa '
then
>&2 printf -- \
'%s\n' \
"varnishncsa not running."
'%s' \
"varnishncsa not running"
exit 1
fi
}
Expand Down
4 changes: 2 additions & 2 deletions src/usr/sbin/varnishd-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function main ()
fi

trap "__cleanup" \
INT TERM EXIT
EXIT INT TERM
__create_lock

proxy="$(
Expand Down Expand Up @@ -523,7 +523,7 @@ function main ()
__create_state
__cleanup
trap - \
INT TERM EXIT
EXIT INT TERM

exec \
${proxy} \
Expand Down
4 changes: 2 additions & 2 deletions src/usr/sbin/varnishncsa-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function main ()
fi

trap "__cleanup" \
INT TERM EXIT
EXIT INT TERM
__create_lock

proxy="$(
Expand Down Expand Up @@ -220,7 +220,7 @@ function main ()
__create_state
__cleanup
trap - \
INT TERM EXIT
EXIT INT TERM

if [[ ${verbose} == true ]]
then
Expand Down
Loading

0 comments on commit d8d56b1

Please sign in to comment.