Skip to content

Commit c583d9b

Browse files
authored
Merge pull request #61 from CDLUC3/readzk
Readzk
2 parents 5813561 + ea6f18f commit c583d9b

35 files changed

+680
-199
lines changed

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,4 @@ mysql-deps/mysql-dependencies.zip
1616
~$MerrittAdminTool.pptx
1717
.bundle/
1818
vendor/
19-
src-admintool/Gemfile.lock
20-
src-admintool/vendor/bundle/ruby/2.6.0/bundler/gems/uc3-ssm-74b5d8da5e54
2119
consistency-driver/out.txt
22-
consistency-driver/Gemfile.lock
23-
src-colladmin/Gemfile.lock
24-
src-common/Gemfile.lock
25-
src-testdriver/Gemfile.lock

cognito-lambda-nonvpc/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.bundle/
22
vendor/
33
README.md
4-
Dockerfile
4+
Dockerfile
5+
Gemfile.lock

cognito-lambda-nonvpc/Gemfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ GEM
33
specs:
44
ast (2.4.2)
55
aws-eventstream (1.3.0)
6-
aws-partitions (1.895.0)
7-
aws-sdk-cognitoidentityprovider (1.87.0)
8-
aws-sdk-core (~> 3, >= 3.191.0)
6+
aws-partitions (1.922.0)
7+
aws-sdk-cognitoidentityprovider (1.90.0)
8+
aws-sdk-core (~> 3, >= 3.193.0)
99
aws-sigv4 (~> 1.1)
10-
aws-sdk-core (3.191.3)
10+
aws-sdk-core (3.194.0)
1111
aws-eventstream (~> 1, >= 1.3.0)
1212
aws-partitions (~> 1, >= 1.651.0)
1313
aws-sigv4 (~> 1.8)
1414
jmespath (~> 1, >= 1.6.1)
1515
aws-sigv4 (1.8.0)
1616
aws-eventstream (~> 1, >= 1.0.2)
1717
jmespath (1.6.2)
18-
json (2.7.1)
18+
json (2.7.2)
1919
language_server-protocol (3.17.0.3)
2020
parallel (1.24.0)
21-
parser (3.3.0.5)
21+
parser (3.3.1.0)
2222
ast (~> 2.4.1)
2323
racc
2424
racc (1.7.3)
2525
rainbow (3.1.1)
2626
regexp_parser (2.9.0)
2727
rexml (3.2.6)
28-
rubocop (1.62.0)
28+
rubocop (1.63.4)
2929
json (~> 2.3)
3030
language_server-protocol (>= 3.17.0)
3131
parallel (~> 1.10)
@@ -36,8 +36,8 @@ GEM
3636
rubocop-ast (>= 1.31.1, < 2.0)
3737
ruby-progressbar (~> 1.7)
3838
unicode-display_width (>= 2.4.0, < 3.0)
39-
rubocop-ast (1.31.1)
40-
parser (>= 3.3.0.4)
39+
rubocop-ast (1.31.3)
40+
parser (>= 3.3.1.0)
4141
ruby-progressbar (1.13.0)
4242
unicode-display_width (2.5.0)
4343

mysql-ruby-lambda/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.bundle/
22
vendor/
33
README.md
4-
Dockerfile
4+
Dockerfile
5+
Gemfile.lock

mysql-ruby-lambda/Gemfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ GEM
1313
specs:
1414
ast (2.4.2)
1515
aws-eventstream (1.3.0)
16-
aws-partitions (1.895.0)
17-
aws-sdk-core (3.191.3)
16+
aws-partitions (1.922.0)
17+
aws-sdk-core (3.194.0)
1818
aws-eventstream (~> 1, >= 1.3.0)
1919
aws-partitions (~> 1, >= 1.651.0)
2020
aws-sigv4 (~> 1.8)
2121
jmespath (~> 1, >= 1.6.1)
22-
aws-sdk-ssm (1.165.0)
23-
aws-sdk-core (~> 3, >= 3.191.0)
22+
aws-sdk-ssm (1.168.0)
23+
aws-sdk-core (~> 3, >= 3.193.0)
2424
aws-sigv4 (~> 1.1)
2525
aws-sigv4 (1.8.0)
2626
aws-eventstream (~> 1, >= 1.0.2)
2727
jmespath (1.6.2)
28-
json (2.7.1)
28+
json (2.7.2)
2929
language_server-protocol (3.17.0.3)
3030
logger (1.6.0)
3131
mysql2 (0.5.6)
3232
parallel (1.24.0)
33-
parser (3.3.0.5)
33+
parser (3.3.1.0)
3434
ast (~> 2.4.1)
3535
racc
3636
racc (1.7.3)
3737
rainbow (3.1.1)
3838
regexp_parser (2.9.0)
3939
rexml (3.2.6)
40-
rubocop (1.62.0)
40+
rubocop (1.63.4)
4141
json (~> 2.3)
4242
language_server-protocol (>= 3.17.0)
4343
parallel (~> 1.10)
@@ -48,8 +48,8 @@ GEM
4848
rubocop-ast (>= 1.31.1, < 2.0)
4949
ruby-progressbar (~> 1.7)
5050
unicode-display_width (>= 2.4.0, < 3.0)
51-
rubocop-ast (1.31.1)
52-
parser (>= 3.3.0.4)
51+
rubocop-ast (1.31.3)
52+
parser (>= 3.3.1.0)
5353
ruby-progressbar (1.13.0)
5454
unicode-display_width (2.5.0)
5555
yaml (0.2.1)

run_bundle.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
cd mysql-ruby-lambda
3+
echo
4+
pwd
5+
echo '==========='
6+
bundle install
7+
bundle update
8+
bundle exec rubocop || exit
9+
cd ../src-common
10+
echo
11+
pwd
12+
echo '==========='
13+
bundle install
14+
bundle update
15+
bundle exec rubocop || exit
16+
cd ../src-admintool
17+
echo
18+
pwd
19+
echo '==========='
20+
bundle install
21+
bundle update
22+
bundle exec rubocop || exit
23+
cd ../src-colladmin
24+
echo
25+
pwd
26+
echo '==========='
27+
rm -rf vendor/bundle/ruby/3*/bundler/gems/mrt-zk*
28+
bundle install
29+
bundle update
30+
bundle exec rubocop || exit
31+
cd ../src-testdriver
32+
echo
33+
pwd
34+
echo '==========='
35+
bundle install
36+
bundle update
37+
bundle exec rubocop || exit
38+
cd ../cognito-lambda-nonvpc
39+
echo
40+
pwd
41+
echo '==========='
42+
bundle install
43+
bundle update
44+
bundle exec rubocop || exit

simulate-lambda-alb/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.bundle/
22
vendor/
33
README.md
4-
Dockerfile
4+
Dockerfile
5+
Gemfile.lock

src-admintool/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Dockerfile
2-
vendor/
2+
vendor/
3+
Gemfile.lock

src-admintool/Gemfile.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,38 @@ GEM
1313
specs:
1414
ast (2.4.2)
1515
aws-eventstream (1.3.0)
16-
aws-partitions (1.895.0)
17-
aws-sdk-core (3.191.3)
16+
aws-partitions (1.922.0)
17+
aws-sdk-core (3.194.0)
1818
aws-eventstream (~> 1, >= 1.3.0)
1919
aws-partitions (~> 1, >= 1.651.0)
2020
aws-sigv4 (~> 1.8)
2121
jmespath (~> 1, >= 1.6.1)
22-
aws-sdk-kms (1.77.0)
23-
aws-sdk-core (~> 3, >= 3.191.0)
22+
aws-sdk-kms (1.80.0)
23+
aws-sdk-core (~> 3, >= 3.193.0)
2424
aws-sigv4 (~> 1.1)
25-
aws-sdk-s3 (1.143.0)
26-
aws-sdk-core (~> 3, >= 3.191.0)
25+
aws-sdk-s3 (1.149.0)
26+
aws-sdk-core (~> 3, >= 3.194.0)
2727
aws-sdk-kms (~> 1)
2828
aws-sigv4 (~> 1.8)
29-
aws-sdk-ssm (1.165.0)
30-
aws-sdk-core (~> 3, >= 3.191.0)
29+
aws-sdk-ssm (1.168.0)
30+
aws-sdk-core (~> 3, >= 3.193.0)
3131
aws-sigv4 (~> 1.1)
3232
aws-sigv4 (1.8.0)
3333
aws-eventstream (~> 1, >= 1.0.2)
3434
jmespath (1.6.2)
35-
json (2.7.1)
35+
json (2.7.2)
3636
language_server-protocol (3.17.0.3)
3737
logger (1.6.0)
3838
mysql2 (0.5.6)
3939
parallel (1.24.0)
40-
parser (3.3.0.5)
40+
parser (3.3.1.0)
4141
ast (~> 2.4.1)
4242
racc
4343
racc (1.7.3)
4444
rainbow (3.1.1)
4545
regexp_parser (2.9.0)
4646
rexml (3.2.6)
47-
rubocop (1.62.0)
47+
rubocop (1.63.4)
4848
json (~> 2.3)
4949
language_server-protocol (>= 3.17.0)
5050
parallel (~> 1.10)
@@ -55,8 +55,8 @@ GEM
5555
rubocop-ast (>= 1.31.1, < 2.0)
5656
ruby-progressbar (~> 1.7)
5757
unicode-display_width (>= 2.4.0, < 3.0)
58-
rubocop-ast (1.31.1)
59-
parser (>= 3.3.0.4)
58+
rubocop-ast (1.31.3)
59+
parser (>= 3.3.1.0)
6060
ruby-progressbar (1.13.0)
6161
unicode-display_width (2.5.0)
6262
yaml (0.2.1)

src-admintool/lambda_function.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,15 @@ def template_parameters(path, myparams)
9999
end
100100

101101
def self.get_collection_map(client)
102-
m = []
103102
stmt = client.prepare(%(
104103
select mnemonic,name from inv.inv_collections
105104
where mnemonic is not null and mnemonic not like '%sla'
106105
order by mnemonic
107106
))
108107
results = stmt.execute
109-
results.each do |r|
110-
m.push({ mnemonic: r.values[0], name: r.values[1] })
108+
results.map do |r|
109+
{ mnemonic: r.values[0], name: r.values[1] }
111110
end
112-
m
113111
end
114112

115113
def get_report_url(key)
@@ -185,11 +183,9 @@ def get_reports_map
185183
rptmap[path] = [] unless rptmap.key?(path)
186184
rptmap[path].push(rpt)
187185
end
188-
maplist = []
189-
rptmap.keys.sort.each do |p|
190-
maplist.push({ path: p, reports: rptmap[p] })
186+
rptmap.keys.sort.map do |p|
187+
{ path: p, reports: rptmap[p] }
191188
end
192-
maplist
193189
end
194190
end
195191
end

src-admintool/queries/idlist_compare_query.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ def get_title
1212
end
1313

1414
def get_placeholders
15-
buf = []
16-
get_params.each do |_ark|
17-
buf.append('?')
15+
buf = get_params.map do |_ark|
16+
'?'
1817
end
1918
buf.join(',')
2019
end

src-admintool/queries/idlist_query.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ def get_title
1212
end
1313

1414
def get_placeholders
15-
buf = []
16-
get_params.each do |_ark|
17-
buf.append('?')
15+
buf = get_params.map do |_ark|
16+
'?'
1817
end
1918
buf.join(',')
2019
end

src-admintool/queries/invoices_query.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,13 @@ def campus_params(campus)
355355
end
356356

357357
def get_alternative_queries
358-
queries = []
359358
campuses = @campus.empty? ? %w[UCB UCD UCI UCLA UCM UCR UCSB UCSC UCSD UCSF] : ['']
360-
campuses.each do |campus|
361-
queries.append({
359+
campuses.map do |campus|
360+
{
362361
label: campus.empty? ? 'All Campuses' : campus,
363362
url: params_to_str(campus_params(campus)),
364363
class: 'campus'
365-
})
364+
}
366365
end
367-
queries
368366
end
369367
end

src-admintool/queries/query.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ def get_headers(results)
9898
end
9999

100100
def get_types(results)
101-
types = []
102-
results.fields.each do
103-
types.push('')
101+
results.fields.map do |_col|
102+
''
104103
end
105104
end
106105

src-colladmin/.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Dockerfile
22
README.md
3-
vendor/
3+
vendor/
4+
Gemfile.lock

src-colladmin/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM ${ECR_REGISTRY}/uc3-mrt-admin-common
1313
RUN yum -y update
1414

1515
# Build rest-client gem from source
16-
RUN yum -y install gcc-c++
16+
RUN yum -y install gcc-c++ && yum -y groupinstall "Development Tools"
1717

1818
# Add Admin Tool Code to the image
1919
COPY . /var/task/

src-colladmin/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ gem 'aws-sdk-lambda'
1212
gem 'aws-sdk-s3'
1313
gem 'aws-sdk-ssm'
1414
gem 'csv'
15+
gem 'mrt-zk', git: 'https://github.com/CDLUC3/mrt-zk.git', tag: '1.0.2.a'
1516
gem 'rest-client'
1617
gem 'rubocop'
1718
gem 'uc3-ssm', '0.3.10', git: 'https://github.com/CDLUC3/uc3-ssm.git', branch: 'main'
1819
gem 'unf_ext', '~> 0.0.7.7'
20+
gem 'zk'
21+
gem 'zookeeper'

0 commit comments

Comments
 (0)