Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef 11677/chef 12498/lbaker erlang upgrade #3877

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .expeditor/automate_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL=false
export HAB_FEAT_IGNORE_LOCAL=false
export HAB_STUDIO_HOST_ARCH=x86_64-linux
export HAB_FEAT_OFFLINE_INSTALL=true
export HAB_BLDR_CHANNEL: "LTS-2024"
export HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "LTS-2024"
export HAB_FALLBACK_CHANNEL: "LTS-2024"

curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash

Expand Down
13 changes: 13 additions & 0 deletions .expeditor/build.habitat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
env:
HAB_BLDR_CHANNEL: "LTS-2024"
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "LTS-2024"
HAB_FALLBACK_CHANNEL: "LTS-2024"

origin: chef
smart_build: false
studio_secrets:
HAB_BLDR_CHANNEL:
value: "LTS-2024"
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL:
value: "LTS-2024"
HAB_FALLBACK_CHANNEL:
value: "LTS-2024"


1 change: 1 addition & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,4 @@ artifact_channels:
- unstable
- current
- stable
- LTS-2024
2 changes: 1 addition & 1 deletion .expeditor/create_manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_latest(channel, origin, name)
def get_hab_deps_latest()
ret = {}
["hab", "hab-sup", "hab-launcher"].each do |name|
d = get_latest("stable", "core", name)
d = get_latest("LTS-2024", "core", name)
ret[name] = "#{d["origin"]}/#{d["name"]}/#{d["version"]}/#{d["release"]}"
end
ret
Expand Down
2 changes: 1 addition & 1 deletion .license_scout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ habitat:
- origin: chef
channel: unstable
- origin: core
channel: stable
channel: LTS-2024

allowed_licenses:
- Apache-1.0
Expand Down
24 changes: 13 additions & 11 deletions oc-chef-pedant/spec/api/stats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@
"pg_stat_seq_scan" => "COUNTER",
}

MNESIA_RESPONSE_TYPE_MAP = {
"erlang_mnesia_held_locks" => "GAUGE",
"erlang_mnesia_lock_queue" => "GAUGE",
"erlang_mnesia_transaction_participants" => "GAUGE",
"erlang_mnesia_transaction_coordinators" => "GAUGE",
"erlang_mnesia_failed_transactions" => "COUNTER",
"erlang_mnesia_committed_transactions" => "GAUGE",
"erlang_mnesia_logged_transactions" => "COUNTER",
"erlang_mnesia_restarted_transactions" => "COUNTER"
}
# pedant test failures here after upgrading to erlang 26x
#
#MNESIA_RESPONSE_TYPE_MAP = {
# "erlang_mnesia_held_locks" => "GAUGE",
# "erlang_mnesia_lock_queue" => "GAUGE",
# "erlang_mnesia_transaction_participants" => "GAUGE",
# "erlang_mnesia_transaction_coordinators" => "GAUGE",
# "erlang_mnesia_failed_transactions" => "COUNTER",
# "erlang_mnesia_committed_transactions" => "GAUGE",
# "erlang_mnesia_logged_transactions" => "COUNTER",
# "erlang_mnesia_restarted_transactions" => "COUNTER"
#}

CHEF_INDEX_TYPE_MAP_ES = {
"chef_elasticsearch_update_count" => "COUNTER",
Expand Down Expand Up @@ -168,7 +170,7 @@

SHARED_TYPE_MAP = ERLANG_RESPONSE_TYPE_MAP.merge(CHEF_INDEX_TYPE_MAP)
RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(CHEF_INDEX_JSON_TYPE_MAP)
PROMETHEUS_RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(MNESIA_RESPONSE_TYPE_MAP).merge(CHEF_INDEX_PROMETHEUS_TYPE_MAP)
PROMETHEUS_RESPONSE_TYPE_MAP = SHARED_TYPE_MAP.merge(CHEF_INDEX_PROMETHEUS_TYPE_MAP)

if Pedant::Config.chef_pgsql_collector
RESPONSE_TYPE_MAP = RESPONSE_TYPE_MAP.merge(PGSTATS_RESPONSE_TYPE_MAP)
Expand Down
2 changes: 1 addition & 1 deletion omnibus_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# When updating this, check doc/FrequentTasks.md for checklists to ensure all
# the various usages are updated in lockstep
#
override :erlang, version: "24.3.2"
override :erlang, version: "26.2.5.2"
override :'omnibus-ctl', version: "main"
override :chef, version: "v17.10.0"
override :ohai, version: "v16.17.0"
Expand Down
6 changes: 3 additions & 3 deletions scripts/bk_tests/bk_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ cp /workdir/scripts/bk_tests/pb_hba.conf /etc/postgresql/13/main/pg_hba.conf
# the erlang software definition lives in: /omnibus-software/config/software/erlang.rb

# this is needed until the erlang version is installed in the docker container
echo "Installing erlang 24.3.2"
asdf install erlang 24.3.2
asdf local erlang 24.3.2
echo "Installing erlang 26.2.5.2"
asdf install erlang 26.2.5.2
asdf local erlang 26.2.5.2
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell

echo "Installing Bundler"
Expand Down
Binary file modified scripts/elvis
Binary file not shown.
4 changes: 2 additions & 2 deletions src/bookshelf/elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{elvis_style, no_if_expression},
{elvis_style, no_debug_call, #{ignore => [bksw_app]}},
{elvis_style, no_nested_try_catch},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace},
{elvis_style, operator_spaces},
{elvis_style, used_ignored_variable},
{elvis_style, variable_naming_convention}
Expand Down
6 changes: 3 additions & 3 deletions src/bookshelf/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ pkg_origin=chef
pkg_license=('Apache-2.0')
pkg_maintainer="The Chef Server Maintainers <[email protected]>"
pkg_deps=(
core/erlang24
core/cacerts
core/erlang26
core/cacertsl
core/coreutils
core/gcc-libs
core/sqitch_pg
core/sqitch
)
pkg_build_deps=(core/make core/git core/gcc)
pkg_bin_dirs=(bin)
Expand Down
9 changes: 4 additions & 5 deletions src/bookshelf/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 ft=erlang et

{require_otp_vsn, "24.3.2"}.
{require_otp_vsn, "26.2.5.2"}.

{erl_dep_retries, 10}.

Expand All @@ -16,10 +16,8 @@
{git, "https://github.com/chef/chef_secrets", {branch, "main"}}},
{envy, ".*",
{git, "https://github.com/markan/envy", {branch, "master"}}},
{eper, ".*",
{git, "https://github.com/massemanet/eper", {branch, "master"}}},
{erlcloud, ".*",
{git, "https://github.com/chef/erlcloud", {branch, "lbaker/presigned-headers"}}},
{git, "https://github.com/chef/erlcloud", {branch, "CHEF-11677/CHEF-12498/lbaker"}}},
{erlsom, ".*",
{git, "https://github.com/chef/erlsom", {branch, "integer_long_string_probs2"}}},
{erlware_commons, ".*",
Expand Down Expand Up @@ -56,6 +54,8 @@

{plugins, [pc]}.

{dialyzer, [{warnings, [no_unknown]}]}.

{xref_checks,
[undefined_function_calls,
undefined_functions,
Expand Down Expand Up @@ -132,7 +132,6 @@
{mixer, load},
syntax_tools,
compiler,
eper,
observer_cli,
{pooler, load},
{sqerl, load}
Expand Down
28 changes: 12 additions & 16 deletions src/bookshelf/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@
0},
{<<"chef_secrets">>,
{git,"https://github.com/chef/chef_secrets",
{ref,"6fa36689fd599602e5985587a1497282df2d907a"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
0},
{<<"eini">>,
{git,"https://github.com/erlcloud/eini",
{ref,"511a94254d6eecc9331da31cd4fa08ff64b4d2e2"}},
1},
{<<"ej">>,
{git,"https://github.com/chef/ej",
{ref,"f843f4da1cb7d8d2414adccc37fe523e3f92d789"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
1},
{<<"envy">>,
{git,"https://github.com/markan/envy",
{ref,"0148fb4b7ed0e188511578e98b42d6e7dde0ebd1"}},
0},
{<<"eper">>,
{git,"https://github.com/massemanet/eper",
{ref,"17b0f97ea8287b72e8ebbe7132214db182ff1a1d"}},
0},
{<<"epgsql">>,
{git,"https://github.com/chef/epgsql-1.git",
{ref,"34b4182f0e21f9189ddd7b2e290f01a9e7d93bf1"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
1},
{<<"erlcloud">>,
{git,"https://github.com/chef/erlcloud",
{ref,"27724cc615bb71595e88665ffd3ea083bf51ecb3"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
0},
{<<"erlsom">>,
{git,"https://github.com/chef/erlsom",
{ref,"131e660ee39254a58b75075e07dfd742f445bfce"}},
{branch, "integer_long_string_probs2"}},
0},
{<<"erlware_commons">>,
{git,"https://github.com/chef/erlware_commons",
Expand Down Expand Up @@ -67,16 +63,16 @@
{ref,"a140ea935eae9149bb35234bb40f6acf1c69caa1"}},
0},
{<<"lhttpc">>,
{git,"https://github.com/erlcloud/lhttpc",
{ref,"8e34985a3cd0ac2a7fc2a88a041554c64d33e74b"}},
{git,"https://github.com/chef/lhttpc",
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
1},
{<<"meck">>,
{git,"https://github.com/eproxus/meck",
{ref,"e48641a20a605174e640ac91a528d443be11c9b9"}},
0},
{<<"mini_s3">>,
{git,"https://github.com/chef/mini_s3",
{ref,"4dd584fce031d35bbe5c4b72a04660b75673ca21"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
0},
{<<"mixer">>,
{git,"https://github.com/inaka/mixer",
Expand All @@ -92,25 +88,25 @@
0},
{<<"opscoderl_wm">>,
{git,"https://github.com/chef/opscoderl_wm",
{ref,"5436cc600db462226a5d2f3ed585ab39eaf20ee5"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
0},
{<<"pooler">>,
{git,"https://github.com/chef/pooler.git",
{ref,"681c355abaacc5487ddf41a84b9ed53151a765fe"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
1},
{<<"recon">>,
{git,"https://github.com/ferd/recon/",
{ref,"f7b6c08e6e9e2219db58bfb012c58c178822e01e"}},
1},
{<<"sqerl">>,
{git,"https://github.com/chef/sqerl",
{ref,"ebbe4c20ab5cd21041229d22dd60a6b38aa2930c"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
0},
{<<"sync">>,
{git,"https://github.com/rustyio/sync",
{ref,"7c9367e73b7dbb01a788f8d0120d747330112f6f"}},
0},
{<<"webmachine">>,
{git,"https://github.com/chef/webmachine",
{ref,"1389b01a9fbc25d36aad8956e08d2d0db242625f"}},
{branch,"CHEF-11677/CHEF-12498/lbaker"}},
1}].
Binary file modified src/bookshelf/rebar3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ start(_StartType, _StartArgs) ->
SrcDir = filename:join([Dir, "../../../../../..", "external-deps"]),
EbinDir = filename:join([Dir, "../../../../../..", "external-deps/ebin"]),
application:set_env(sync, src_dirs, {add, [{SrcDir,
[{outdir,EbinDir}]}]}),
[{outdir, EbinDir}]}]}),
application:set_env(sync, sync_method, scanner),
application:start(sync);
_ -> ok
Expand Down
4 changes: 2 additions & 2 deletions src/bookshelf/src/bksw_cleanup_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ force_upload_cleanup() ->

init(_Args) ->
UploadInterval = envy:get(bookshelf, abandoned_upload_cleanup_interval, 19 * ?MIN_IN_MS, positive_integer),
CleanupInterval = envy:get(bookshelf,deleted_data_cleanup_interval, 7 * ?MIN_IN_MS, positive_integer),
State = #state{upload_cleanup_interval = UploadInterval, deleted_cleanup_interval = CleanupInterval} ,
CleanupInterval = envy:get(bookshelf, deleted_data_cleanup_interval, 7 * ?MIN_IN_MS, positive_integer),
State = #state{upload_cleanup_interval = UploadInterval, deleted_cleanup_interval = CleanupInterval},
spawn_timers(State),
{ok, State}.

Expand Down
8 changes: 4 additions & 4 deletions src/bookshelf/src/bksw_io.erl
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ filter_entries(Bucket, Entries) ->

filter_entries(_Bucket, [], _Ex, Accum) ->
lists:reverse(Accum);
filter_entries(Bucket, [Entry|T], Ex, Accum) ->
filter_entries(Bucket, [Entry | T], Ex, Accum) ->
case re:run(Entry, Ex, [{capture, none}]) of
nomatch ->
case entry_md(Bucket, filename:basename(Entry)) of
{ok, Obj} ->
filter_entries(Bucket, T, Ex, [Obj|Accum]);
filter_entries(Bucket, T, Ex, [Obj | Accum]);
_Error ->
filter_entries(Bucket, T, Ex, Accum)
end;
Expand All @@ -301,13 +301,13 @@ make_buckets(Root, BucketDirs) ->

make_buckets(_Root, [], Buckets) ->
lists:reverse(Buckets);
make_buckets(Root, [BucketDir|T], Buckets) ->
make_buckets(Root, [BucketDir | T], Buckets) ->
Buckets1 = case file:read_file_info(filename:join([Root, BucketDir])) of
{ok, #file_info{mtime=Date}} ->
[UTC | _] = %% FIXME This is a hack until R15B
calendar:local_time_to_universal_time_dst(Date),
[#bucket{name=bksw_io_names:decode(BucketDir),
date=UTC}|Buckets];
date=UTC} | Buckets];
_Error ->
Buckets
end,
Expand Down
14 changes: 7 additions & 7 deletions src/bookshelf/src/bksw_io_names.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
-include_lib("eunit/include/eunit.hrl").
-endif.

hex2dec(X) when (X>=$0) andalso (X=<$9) -> X-$0;
hex2dec(X) when (X>=$A) andalso (X=<$F) -> X-$A+10;
hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10.
hex2dec(X) when (X>=$0) andalso (X=<$9) -> X - $0;
hex2dec(X) when (X>=$A) andalso (X=<$F) -> X - $A + 10;
hex2dec(X) when (X>=$a) andalso (X=<$f) -> X - $a + 10.

-type uri() :: string() | binary().
-type hex_uri() :: string() | binary(). %% Hexadecimal encoded URI.
Expand All @@ -40,10 +40,10 @@ hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10.
http_uri_decode(String) when is_list(String) ->
do_decode(String).

do_decode([$%,Hex1,Hex2|Rest]) ->
[hex2dec(Hex1)*16+hex2dec(Hex2)|do_decode(Rest)];
do_decode([First|Rest]) ->
[First|do_decode(Rest)];
do_decode([$%, Hex1, Hex2 | Rest]) ->
[hex2dec(Hex1) * 16 + hex2dec(Hex2) | do_decode(Rest)];
do_decode([First | Rest]) ->
[First | do_decode(Rest)];
do_decode([]) ->
[].

Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_req.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ generate_id() ->
%% it reset on node restarts -- thus we add os:timestamp/0
%% We can't use os:timestamp/0 only, since it's not guaranteed to be unique
%% in multiple invocations.
Id = term_to_binary({node(), os:timestamp(), erlang:unique_integer([positive])}),
Id = term_to_binary({node(), os:timestamp(), erlang:unique_integer([positive])}, [{minor_version, 1}]),
bksw_format:to_base64(Id).
14 changes: 7 additions & 7 deletions src/bookshelf/src/bksw_sec.erl
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ const_time_compare(_, _, _) ->
false.

-spec ctcomp(string(), string(), boolean()) -> boolean().
ctcomp([ ], [ ], IsEqual) -> IsEqual;
ctcomp([ ], [_|S2], _) -> ctcomp([], S2, false );
ctcomp([_|S1], [ ], _) -> ctcomp(S1, [], false );
ctcomp([X|S1], [X|S2], IsEqual) -> ctcomp(S1, S2, IsEqual);
ctcomp([_|S1], [_|S2], _) -> ctcomp(S1, S2, false ).
ctcomp([ ], [ ], IsEqual) -> IsEqual;
ctcomp([ ], [_ | S2], _) -> ctcomp([], S2, false );
ctcomp([_ | S1], [ ], _) -> ctcomp(S1, [], false );
ctcomp([X | S1], [X | S2], IsEqual) -> ctcomp(S1, S2, IsEqual);
ctcomp([_ | S1], [_ | S2], _) -> ctcomp(S1, S2, false ).

encode_access_denied_error_response(RequestId, Req0, Context) ->
Req1 = bksw_req:with_amz_id_2(Req0),
Expand All @@ -182,7 +182,7 @@ encode_sign_error_response(AccessKeyId, IncomingSignature,

% split "<bucketname>/<key>" (possibly leading and/or trailing /) into {"bucketname", "key"}
% Path = "<bucketname>/<key>"
-spec get_bucket_key(Path::string()) -> {string(), string()}.
-spec get_bucket_key(Path :: string()) -> {string(), string()}.
get_bucket_key(Path) ->
case string:lexemes(Path, "/") of
[ ] -> {"", ""};
Expand Down Expand Up @@ -228,7 +228,7 @@ host(Req0) ->
% For example, 20150830T123600Z is a valid time stamp. Do not include milliseconds in the time stamp.
%
% 1 =< ExpiresSec =< 604800
-spec is_expired(DateTimeString::string(), ExpiresSec::integer()) -> boolean().
-spec is_expired(DateTimeString :: string(), ExpiresSec :: integer()) -> boolean().
is_expired(DateTimeString, ExpiresSec) ->
[Y1, Y2, Y3, Y4, M1, M2, D1, D2, _, H1, H2, N1, N2, S1, S2, _] = DateTimeString,
Year = list_to_integer([Y1, Y2, Y3, Y4]),
Expand Down
2 changes: 1 addition & 1 deletion src/bookshelf/src/bksw_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ maybe_with_cleanup_task(ChildSpecs) ->
permanent, brutal_kill, worker, [bksw_cleanup_task]},
case bksw_conf:storage_type() of
sql ->
[CleanupTask| ChildSpecs];
[CleanupTask | ChildSpecs];
_ ->
ChildSpecs
end.
Expand Down
Loading
Loading