Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
b54211d
Cuttlefish'ized configuration for name change s/multibag/supercluster/
Oct 6, 2015
72b6f75
Merge pull request #106 from basho/refactor/change-multibag-to-superc…
kuenishi Oct 6, 2015
7f9c726
Don't use any bags
Oct 7, 2015
0e179b9
Merge pull request #107 from basho/refactor/hide-bags-absolutely
shino Oct 7, 2015
9369606
Remove admin.secret from configuration
kuenishi Dec 7, 2015
e2268c4
Change R value to let Stanchion start under single node failure
kuenishi Dec 14, 2015
87d1be1
Merge pull request #108 from basho/ku/remove-admin-secret
shino Dec 15, 2015
12ea3ca
Bump node_package to 2.0.5
Mar 19, 2016
b452bee
Use node_package 3.0.0
Mar 21, 2016
673ea90
Merge pull request #109 from basho/mra/rcs-357
Mar 21, 2016
2ba9db0
update RNs
tburghart Mar 23, 2016
dab2195
add 'to'
tburghart Mar 23, 2016
9ba4ec2
make eper tag explicit
tburghart Mar 23, 2016
baebc78
Created Stanchion Debug
Bob-The-Marauder May 2, 2019
cb8e2dc
Added crossreferences and missing template file
Bob-The-Marauder May 2, 2019
1ede3fd
upgrade to rebar3 part 1/n
Mar 25, 2021
91d77c1
brush up eunit tests for otp-22
Mar 25, 2021
d570eb2
fix up rebase artifacts
Mar 25, 2021
bb1d068
missing dependent apps in stanchion.app.src
Mar 25, 2021
63b9d35
brush up Makefile
Mar 30, 2021
12046ef
move stanchion.schema back to /priv
Mar 31, 2021
3640088
rebar.config & Makefile fixups
Mar 31, 2021
01001c4
explicitly depend on mochiweb v2.20.1, unbreaking mochiweb_http:after…
Apr 5, 2021
cdf39b4
bring back lager
Apr 6, 2021
9581313
s/logger/lager/ back, in code
Apr 19, 2021
79b2d0e
spellcheck 'notfound' in return value of riakc_pb_socket:get
Apr 20, 2021
1668350
lager has no 'fatal' level
Apr 22, 2021
04ef071
support docker
Apr 22, 2021
acc8c44
Dockerfile fixups
Apr 23, 2021
280ebdc
delete obsoleted riak_test bits
Apr 26, 2021
15adfa5
fix stanchion-admin; ensure log dir is created in release
Jun 14, 2021
d26a1e7
stanchion.schema has moved
Jul 15, 2021
214bffb
implement bucket versioning
Jul 27, 2021
5e9bcc1
update rebar3 binary
Aug 13, 2021
7dd77cc
remove code shared with riak_cs, depend on rcs_common
Aug 13, 2021
56cfc25
bulk update copyright notice
Aug 13, 2021
02af12f
dialyzer treatment
Aug 13, 2021
aff1f31
whitespace cleanup & formatting touchups
Aug 13, 2021
dff395f
bump riakc dep to riak_kv-3.0.7
Aug 13, 2021
ffb7976
rebar.lock version 1.2.0
Aug 13, 2021
57f08a2
we can prune manifests in stanchion_utils:get_manifests
Aug 13, 2021
90df0ca
fix lager call in wm_error_handler
Aug 13, 2021
4391e7b
add rel_vsn in vars.config, per new relx process and paths
Aug 13, 2021
8371a56
make rebar.config similar to that in riak_cs, unbreak devrel target
Aug 15, 2021
f925bc4
update rcs_common repo and sha
Aug 16, 2021
ef9937d
upgrade deps
Aug 20, 2021
24fe952
don't forget to include erts in rel profile
Sep 16, 2021
acced0f
make rel should copy release from _build to rel
Oct 1, 2021
3959a8b
deb and rpm packaging
Nov 8, 2021
d89dde1
update rebar3 to latest (3.17)
Nov 9, 2021
eb05cb3
add entry for 3.0 in RELEASE-NOTES
Nov 9, 2021
c67674f
.dockerignore touchup
Nov 10, 2021
25f7877
always clean rel/stanchion before building a rel- target
Nov 11, 2021
2938ec5
duplicate relclean target
Nov 11, 2021
45595b3
Dockerfile that produces a really configurable image
Nov 11, 2021
4aa4e92
un-hardcode & rm trailing / on PIPE_DIR in rel/files/riak-cs
Nov 16, 2021
ca4e52b
rm /var/lib/stanchion in debian/postrm
Nov 16, 2021
e5ba04e
tighter permissions for config and state dirs
Nov 16, 2021
9738c07
fix pid_dir trailing / for rpm, too
Nov 16, 2021
482b346
fix log and state dir perms for rpm, too
Nov 16, 2021
c314f72
tweak perms in specfile %files section
Nov 16, 2021
da9b5b0
rm leftovers in /etc and /var/lib in specfile %postun section
Nov 16, 2021
ef58828
Merge pull request #1 from TI-Tokyo/andreiz/develop-3.0/1-pid_dir-and…
Bob-The-Marauder Nov 18, 2021
00cbe94
pull rebar3_cuttlefish from repo under company org
Nov 19, 2021
ade314e
use rebar3 that suppresses stderr when counting rev-list
Nov 28, 2021
03a940a
amazon linux is rpm-based
Nov 28, 2021
6783357
update rebar3 (see https://github.com/erlang/rebar3/pull/2654)
Nov 30, 2021
73028fd
packaging for freebsd (ng)
Dec 1, 2021
7d9740c
fix distclean target
hmmr Dec 9, 2021
e8df4b9
configure setup in advanced.config
Dec 10, 2021
a1f048f
fix paths in stanchion.service
Dec 10, 2021
cd28774
simplify stanchion launcher
Dec 13, 2021
616835a
teach stanchion-admin to report version
Dec 13, 2021
cd016d4
Merge branch 'develop-3.0' of github.com:hmmr/stanchion into develop-3.0
Dec 10, 2021
bd457a4
have pidfile owned by root
Dec 13, 2021
743b673
drop stanchion ertspath from stanchion-debug
Dec 13, 2021
db0a43b
fixups
Dec 13, 2021
3795e63
stanchion_version in deb/ and rpm/vars.config, too
Dec 13, 2021
1ecbfd7
debian11 has pidfiles in /run, but there's a symlink for <11
Dec 13, 2021
8ec501c
fix install dirs in rpm/specfile
Dec 14, 2021
f273a0f
special case of su on centos8
Dec 14, 2021
5c72b28
fix paths in rpm service file
Dec 14, 2021
3f0b05d
silence a chown in launcher script
Dec 14, 2021
231f4c0
drop rpm dependency on systemd-rpm-macros (n/a in centos7)
Dec 14, 2021
71edb22
squelch amazon linux su, too
hmmr Dec 17, 2021
0d1e5f0
uniformly use "riak" as default cookie (helps with riak_cs_test)
hmmr Dec 16, 2021
a5d53ac
no need for dummy vm.args with new relx
hmmr Dec 16, 2021
c2cd3df
sort out which scripts go to where, in pkg/*
hmmr Dec 16, 2021
4bb6be8
fix stanchion_console:version/1
Dec 16, 2021
243b624
standardize platform_gen_dir
hmmr Dec 20, 2021
4f2848b
keep paths created in devrel under rel
hmmr Dec 20, 2021
b7315cd
fixup launcher
Dec 20, 2021
bdf3fce
fixups
Dec 20, 2021
f958006
launcher su won't start at first run
Dec 21, 2021
3aa6d76
workaround for su - in launcher
Dec 21, 2021
4583b9c
drop unused parity-test target
hmmr Dec 21, 2021
c2091b3
predefine RELEASE_INSTALL_PREFIX for rel target
hmmr Dec 21, 2021
5d09a1a
rely on STANCHION_PATH in in release produced with make rel
Dec 21, 2021
e48ae9c
create unique su_piggy in launcher script
Dec 23, 2021
ef60318
another go at making make rel relocatable again
Dec 23, 2021
9f7428e
osx packaging WIP
Dec 24, 2021
7a271fb
fix up ef6031818
Dec 27, 2021
ce1d2ef
update rebar3 once again, to 3.17+same-name-gitrev-fix
Dec 27, 2021
57d7acd
refactor and repair release assembly
Dec 28, 2021
7e4a673
update rebar3 to 3.18.0
Jan 2, 2022
b992520
new test target
Jan 4, 2022
d1cba07
prepare for release
Jan 4, 2022
8176abd
incremental clean up of Makefile, rebar.config
Feb 15, 2022
c1a68c7
upgrade deps
Feb 15, 2022
66fe248
alpine linux packaging
Feb 15, 2022
3b1d5fd
https:// for github deps
Apr 14, 2022
5f61b91
remove pid file workarounds; adapt to rebar3.18 way to start app with…
Apr 15, 2022
76a5916
add config/vm.args
Apr 15, 2022
59d43a0
restore extended_start_script_extensions
Apr 15, 2022
26a9b1b
duplicate entries in vars.config
Apr 15, 2022
9e47143
correct specs for extended_start_script_hooks
Apr 15, 2022
26fbb8f
drop PIPE_DIR
Apr 15, 2022
995ca48
adjust RPC_HOP to new nodetool rpc calling conventions
Apr 20, 2022
cda7f52
fixups
Apr 20, 2022
31faf7c
more fixups and rpc interop improvements
Apr 20, 2022
a8efb6b
fix su workaround for centos7
Apr 21, 2022
8d38edb
don't update deps on every make rel
Apr 24, 2022
0a2936b
less artsy rewrite of app_epath
Apr 24, 2022
3026cc9
typo in rebar.config
Apr 24, 2022
4f33bc8
port fixes to alpine build
Apr 30, 2022
d2d1f4c
add missing pid file entry in distro rels
Apr 30, 2022
6d661fc
explicit exit 0 in stanchion-admin at end
Apr 30, 2022
e90ef5f
use plain {vsn, git} in stanchion.app.src
hmmr May 2, 2022
438383f
use https:// scheme in github deps
May 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
log/
misc/
dev/
_build/
rel/pkg/
rel/stanchion/
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
.eunit/*
deps/*
priv/*
_build/
rel/stanchion
ebin/*.beam
ebin/*.app
doc
dev
/package/
log/
*~
/log
riak_test/bin/stanchion*
riak_test/bin/stanchion*
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM erlang:22 AS compile-image

EXPOSE 8085

WORKDIR /usr/src/stanchion
COPY . /usr/src/stanchion

# When running in a docker container, ideally we would want our app to
# be configurable via environment variables (option --env-file to
# docker run). For that reason, We use a pared-down, cuttlefish-less
# rebar.config. Configuration from environment now becomes possible,
# via rebar's own method of generating sys.config from
# /sys.config.src.
RUN make rel-docker

FROM debian:bullseye AS runtime-image

COPY --from=compile-image /usr/src/stanchion/rel/stanchion /opt/stanchion

CMD /opt/stanchion/bin/stanchion foreground
161 changes: 94 additions & 67 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,107 +1,134 @@
REPO ?= stanchion

PKG_REVISION ?= $(shell git describe --tags)
PKG_VERSION ?= $(shell git describe --tags | tr - .)
PKG_ID = stanchion-$(PKG_VERSION)
HEAD_REVISION ?= $(shell git describe --tags --exact-match HEAD 2>/dev/null)
PKG_REVISION ?= $(shell git describe --tags 2>/dev/null)
PKG_BUILD = 1
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR ?= $(BASE_DIR)/rebar
ERLANG_BIN = $(shell dirname $(shell which erl 2>/dev/null) 2>/dev/null)
OTP_VER = $(shell erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell)
REBAR ?= $(BASE_DIR)/rebar3
OVERLAY_VARS ?=

.PHONY: rel deps test

all: deps compile
all: compile

compile: deps
@(./rebar compile)
compile:
@($(REBAR) compile)

deps:
@./rebar get-deps
@$(REBAR) upgrade --all

clean:
@./rebar clean

distclean: clean
@./rebar delete-deps
@rm -rf $(PKG_ID).tar.gz
@$(REBAR) clean

parity-test:
@python test/prototype_parity.py -v
distclean: clean devclean relclean
@rm -rf _build

##
## Release targets
##
rel: deps compile
@./rebar compile
@./rebar skip_deps=true generate $(OVERLAY_VARS)
rel: compile
@$(REBAR) as rel release
@cp -a _build/rel/rel/stanchion rel/

rel-rpm: compile relclean
@$(REBAR) as rpm release
@cp -a _build/rpm/rel/stanchion rel/

rel-deb: compile relclean
@$(REBAR) as deb release
@cp -a _build/deb/rel/stanchion rel/

rel-fbsdng: compile relclean
@$(REBAR) as fbsdng release
@cp -a _build/fbsdng/rel/stanchion rel/

rel-alpine: compile relclean
@$(REBAR) as alpine release
@(cd _build/alpine/rel/stanchion/usr/bin && mv stanchion.nosu stanchion)
@cp -a _build/alpine/rel/stanchion rel/

rel-osx: compile relclean
@$(REBAR) as osx release
@cp -a _build/osx/rel/stanchion rel/

rel-docker: compile relclean
@REBAR_CONFIG=rebar.docker.config $(REBAR) release
@cp -a _build/default/rel/stanchion rel/

relclean:
rm -rf rel/stanchion
@rm -rf _build/rel rel/stanchion

test:
@$(REBAR) eunit
@$(REBAR) dialyzer

##
## Developer targets
##
stage : rel
$(foreach dep,$(wildcard deps/*), rm -rf rel/stanchion/lib/$(shell basename $(dep))-* && ln -sf $(abspath $(dep)) rel/stanchion/lib;)
$(foreach app,$(wildcard apps/*), rm -rf rel/stanchion/lib/$(shell basename $(app))-* && ln -sf $(abspath $(app)) rel/stanchion/lib;)

devrel: all
mkdir -p dev
@./rebar skip_deps=true generate target_dir=../dev/$(REPO) \
overlay_vars=dev_vars.config
@mkdir -p dev
@$(REBAR) as rel release -o dev --overlay_vars rel/dev_vars.config

stagedevrel: devrel
$(foreach app,$(wildcard apps/*), rm -rf dev/$(REPO)/lib/$(shell basename $(app))* && ln -sf $(abspath $(app)) dev/$(REPO)/lib;)
$(foreach dep,$(wildcard deps/*), rm -rf dev/$(REPO)/lib/$(shell basename $(dep))* && ln -sf $(abspath $(dep)) dev/$(REPO)/lib;)

devclean: clean
rm -rf dev

##
## Doc targets
## Version and naming variables for distribution and packaging
##
orgs: orgs-doc orgs-README

orgs-doc:
@emacs -l orgbatch.el -batch --eval="(riak-export-doc-dir \"doc\" 'html)"

orgs-README:
@emacs -l orgbatch.el -batch --eval="(riak-export-doc-file \"README.org\" 'ascii)"
@mv README.txt README

DIALYZER_APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool eunit syntax_tools compiler
PLT ?= $(HOME)/.stanchion_dialyzer_plt
# Tag from git with style <tagname>-<commits_since_tag>-<current_commit_hash>
# Ex: When on a tag: riak-1.0.3 (no commits since tag)
# For most normal Commits: riak-1.1.0pre1-27-g1170096
# Last tag: riak-1.1.0pre1
# Commits since tag: 27
# Hash of commit: g1170096
REPO_TAG := $(shell git describe --tags)

# Split off repo name
# Changes to 1.0.3 or 1.1.0pre1-27-g1170096 from example above
REVISION = $(shell echo $(REPO_TAG) | sed -e 's/^$(REPO)-//')

# Primary version identifier, strip off commmit information
# Changes to 1.0.3 or 1.1.0pre1 from example above
MAJOR_VERSION ?= $(shell echo $(REVISION) | sed -e 's/\([0-9.]*\)-.*/\1/')

# Name resulting directory & tar file based on current status of the git tag
# If it is a tagged release (PKG_VERSION == MAJOR_VERSION), use the toplevel
# tag as the package name, otherwise generate a unique hash of all the
# dependencies revisions to make the package name unique.
# This enables the toplevel repository package to change names
# when underlying dependencies change.
NAME_HASH = $(shell git hash-object distdir/$(CLONEDIR)/$(MANIFEST_FILE) 2>/dev/null | cut -c 1-8)
PKG_ID := "$(REPO_TAG)-OTP$(OTP_VER)"

##
## Packaging targets
##

# Yes another variable, this one is repo-<generatedhash
# which differs from $REVISION that is repo-<commitcount>-<commitsha>
PKG_VERSION = $(shell echo $(PKG_ID) | sed -e 's/^$(REPO)-//')

package:
mkdir -p rel/pkg/out/stanchion-$(PKG_ID)
git archive --format=tar HEAD | gzip >rel/pkg/out/$(PKG_ID).tar.gz
$(MAKE) -f rel/pkg/Makefile

packageclean:
rm -rf rel/pkg/out/*


.PHONY: package
export PKG_VERSION PKG_ID PKG_BUILD BASE_DIR ERLANG_BIN REBAR OVERLAY_VARS RELEASE

package.src: deps
mkdir -p package
rm -rf package/$(PKG_ID)
git archive --format=tar --prefix=$(PKG_ID)/ $(PKG_REVISION)| (cd package && tar -xf -)
${MAKE} -C package/$(PKG_ID) deps
mkdir -p package/$(PKG_ID)/priv
git --git-dir=.git describe --tags >package/$(PKG_ID)/priv/vsn.git
for dep in package/$(PKG_ID)/deps/*; do \
echo "Processing dep: $${dep}"; \
mkdir -p $${dep}/priv; \
git --git-dir=$${dep}/.git describe --tags >$${dep}/priv/vsn.git; \
done
find package/$(PKG_ID) -depth -name ".git" -exec rm -rf {} \;
tar -C package -czf package/$(PKG_ID).tar.gz $(PKG_ID)

dist: package.src
cp package/$(PKG_ID).tar.gz .

package: package.src
${MAKE} -C package -f $(PKG_ID)/deps/node_package/Makefile

pkgclean: distclean
rm -rf package

include tools.mk
# Package up a devrel to save time later rebuilding it
pkg-devrel: devrel
echo -n $(PKG_REVISION) > VERSION
tar -czf $(PKG_ID)-devrel.tar.gz dev/ VERSION
rm -rf VERSION

pkg-rel: rel
tar -czf $(PKG_ID)-rel.tar.gz -C rel/ .
35 changes: 34 additions & 1 deletion RELEASE-NOTES.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
* Stanchion 3.0.0 Release Notes
** Changes
- This release is to be used with Riak CS 3.0.0. It requires
OTP-22 and rebar3, with no changes that would affect the user
otherwise.
- Packages (rpm and deb) now rely on systemd, currently available for
Centos 7 and 8, Debian 8 and 11, FreeBSD 13 and OSX 14.
- A Dockerfile.
* Stanchion 2.1.2 Release Notes
** Additions
- Update to node_package 3.0.0
* Stanchion 2.1.1 Release Notes
** Bugs Fixed
- Remove admin.secret from configuration (riak_cs/#1274)
* Stanchion 2.1.0 Release Notes
** Additions
- Add statistics reporting
- Add exometer_core 1.2
- Update to cuttlefish 2.0.4
- Update to eper 0.92-basho1
- Update to lager 2.2.0
- Update to lager_syslog 2.1.1
- Update to node_package 2.0.3
- Update to riakc 2.1.1
* Stanchion 2.0.0 Release Notes
** Additions
- Change to cuttlefish-based configuration
- Add cuttlefish 2.0.1
- Update to eper 0.78
- Update to node_package 2.0.1
- Update to riakc 2.1.0
- Update to webmachine 1.10.8
- Update to Erlang/OTP R16B02
* Stanchion 1.5.0 Release Notes
** Addisions
** Additions
- Update to lager 2.0.3
- Compiles with R16B0x (Releases still by R15B01)
** Bugs Fixed
Expand Down
1 change: 0 additions & 1 deletion apps/stanchion/ebin

This file was deleted.

1 change: 0 additions & 1 deletion apps/stanchion/include

This file was deleted.

34 changes: 34 additions & 0 deletions apps/stanchion/include/stanchion.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
%% ---------------------------------------------------------------------
%%
%% Copyright (c) 2007-2013 Basho Technologies, Inc. All Rights Reserved.
%% 2021 TI Tokyo All Rights Reserved.
%%
%% This file is provided to you 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.
%%
%% ---------------------------------------------------------------------

-record(context, {auth_bypass :: boolean(),
bucket :: undefined | binary(),
owner_id :: undefined | all | string()}).

-define(TURNAROUND_TIME(Call),
begin
StartTime_____tat = os:timestamp(),
Result_____tat = (Call),
EndTime_____tat = os:timestamp(),
{Result_____tat,
timer:now_diff(EndTime_____tat,
StartTime_____tat)}
end).
1 change: 0 additions & 1 deletion apps/stanchion/src

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
{application, stanchion,
[
{description, "stanchion"},
%% 'git' may introduce a '+' character (when building not from a
%% tag), and that plus sign will not go down well with freebsd pkg
%% ('+' is not allowed in +MANIFEST file). Hence we produce a
%% version of vsn that doesn't have it.
{vsn, git},
{modules, []},
{registered, []},
Expand All @@ -12,7 +16,10 @@
crypto,
mochiweb,
webmachine,
lager
exometer_core,
lager,
riakc,
rcs_common
]},
{mod, { stanchion_app, []}},
{env, [
Expand Down
Loading