jets-gems 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -0
- data/lib/jets/gems/agree.rb +5 -1
- data/lib/jets/gems/check.rb +29 -47
- data/lib/jets/gems/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24939370b906b38f2a866ef99ef40d0dae0b24ad8e4b123f109aebdddc509cb0
|
4
|
+
data.tar.gz: d46de1b1dd659bf4d4a17e2bfa806ab19d71efb9c7d60de029c2b0f4d381ae96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ece2839d612ee13f68675d849e1b593534afd5bbfaa3c38f0f228ce4ce07e417fe3cce47e231cadbfd9ff3bde3b319bde08df42ca3f234c7b686eb6d57beefc
|
7
|
+
data.tar.gz: 011fa4f8ff8357f51fd2f94b3332ba2ba069b1feb8e3fd887acbd65d5e2fb48c17f5ac064fa256e27d2ff012972c6c7e19c997add9845873d50857b401427a89
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.2.1]
|
7
|
+
- #2 improve compiled gem detection
|
8
|
+
|
6
9
|
## [0.2.0]
|
7
10
|
- generalized weird_gem check
|
8
11
|
- report ruby version also
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Jets Gems
|
2
2
|
|
3
|
+
[](https://www.boltops.com)
|
4
|
+
|
3
5
|
[Jets](http://rubyonjets.com/) is a Ruby Serverless Framework on AWS Lambda. allows you to create serverless applications with a beautiful language: Ruby. It includes everything required to build an application and deploy it to AWS Lambda. Jets makes serverless simple.
|
4
6
|
|
5
7
|
The jets-gems library works with Jets to download and extract pre-compiled gems that work on AWS Lambda.
|
data/lib/jets/gems/agree.rb
CHANGED
@@ -10,7 +10,11 @@ module Jets::Gems
|
|
10
10
|
return if File.exist?(@agree_file)
|
11
11
|
|
12
12
|
puts <<~EOL
|
13
|
-
Jets sends data about your gems to your specified lambda build service **lambdagems.com** so that it can compile and generate the necessary Lambda layers.
|
13
|
+
Jets sends data about your gems to your specified lambda build service **lambdagems.com** so that it can compile and generate the necessary Lambda layers.
|
14
|
+
|
15
|
+
Reporting gems generally allows Lambdagems to build new gems within few minutes. So if you run into missing gems, you can try deploying again after a few minutes. Non-reported gems may take several days or longer.
|
16
|
+
|
17
|
+
Lambdagems only collects anonymous non-identifiable data.
|
14
18
|
|
15
19
|
Is it okay to send your gem data to Lambdagems? (Y/n)?
|
16
20
|
EOL
|
data/lib/jets/gems/check.rb
CHANGED
@@ -80,7 +80,10 @@ Jets is unable to build a deployment package that will work on AWS Lambda withou
|
|
80
80
|
<% if agree.yes? -%>
|
81
81
|
* No need to report this to us, as we've already been notified.
|
82
82
|
<% elsif agree.no? -%>
|
83
|
-
* You have choosen not to report data to lambdagems so we will not be notified about these missing gems.
|
83
|
+
* You have choosen not to report data to lambdagems so we will not be notified about these missing gems. You can edit ~/.jets/agree to change this.
|
84
|
+
* Reporting gems generally allows Lambdagems to build the missing gems within a few minutes.
|
85
|
+
* You can try redeploying again after a few minutes.
|
86
|
+
* Non-reported gems may take days or even longer to be built.
|
84
87
|
<% end -%>
|
85
88
|
|
86
89
|
Compiled gems usually take some time to figure out how to build as they each depend on different libraries and packages.
|
@@ -96,53 +99,32 @@ EOL
|
|
96
99
|
end
|
97
100
|
memoize :agree
|
98
101
|
|
99
|
-
#
|
100
|
-
# in the directory tree. So lets grab the gem name and figure out the
|
101
|
-
# unique paths of the compiled gems from there.
|
102
|
-
def compiled_gems
|
103
|
-
# @use_gemspec option finds compile gems with Gem::Specification
|
104
|
-
# The normal build process does not use this and checks the file system.
|
105
|
-
# So @use_gemspec is only used for this command:
|
106
|
-
#
|
107
|
-
# jets gems:check
|
108
|
-
#
|
109
|
-
# This is because it seems like some gems like json are remove and screws things up.
|
110
|
-
# We'll filter out for the json gem as a hacky workaround, unsure if there are more
|
111
|
-
# gems though that exhibit this behavior.
|
112
|
-
if @options[:cli]
|
113
|
-
gemspec_compiled_gems
|
114
|
-
else
|
115
|
-
compiled_gems = compiled_gem_paths.map { |p| gem_name_from_path(p) }.uniq
|
116
|
-
# Double check that the gems are also in the gemspec list since that
|
117
|
-
# one is scoped to Bundler and will only included gems used in the project.
|
118
|
-
# This handles the possiblity of stale gems leftover from previous builds
|
119
|
-
# in the cache.
|
120
|
-
# TODO: figure out if we need
|
121
|
-
# compiled_gems.select { |g| gemspec_compiled_gems.include?(g) }
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
# Use pre-compiled gem because the gem could have development header shared
|
126
|
-
# object file dependencies. The shared dependencies are packaged up as part
|
127
|
-
# of the pre-compiled gem so it is available in the Lambda execution environment.
|
102
|
+
# Context, observations, and history:
|
128
103
|
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
#
|
142
|
-
#
|
143
|
-
|
144
|
-
|
145
|
-
|
104
|
+
# Two ways to check if gem is compiled.
|
105
|
+
#
|
106
|
+
# 1. compiled_gem_paths - look for .so and .bundle extension files in the folder itself.
|
107
|
+
# 2. gemspec - uses the gemspec metadata.
|
108
|
+
#
|
109
|
+
# Observations:
|
110
|
+
#
|
111
|
+
# * The gemspec approach generally finds more compiled gems than the compiled_gem_paths approach.
|
112
|
+
# * So when using the compiled_gem_paths some compiled are missed and not properly detected like http-parser.
|
113
|
+
# * However, some gemspec found compiled gems like json are weird and they don't work when they get replaced.
|
114
|
+
#
|
115
|
+
# History:
|
116
|
+
#
|
117
|
+
# * Started with compiled_gem_paths approach
|
118
|
+
# * Tried to gemspec approach, but ran into json-2.1.0 gem issues. bundler removes? http://bit.ly/39T8uln
|
119
|
+
# * Went to selective checking approach with `cli: true` option. This helped gather more data.
|
120
|
+
# * jets deploy - compiled_gem_paths
|
121
|
+
# * jets gems:check - gemspec_compiled_gems
|
122
|
+
# * Going back to compiled_gem_paths with.
|
123
|
+
# * Using the `weird_gem?` check to filter out gems removed by bundler. Note: Only happens with specific versions of json.
|
124
|
+
# * Removed compiled_gem_paths and compiled_gem_paths methods. Can get it from git history if needed again.
|
125
|
+
#
|
126
|
+
def compiled_gems
|
127
|
+
gemspec_compiled_gems
|
146
128
|
end
|
147
129
|
|
148
130
|
# So can also check for compiled gems with Gem::Specification
|
data/lib/jets/gems/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jets-gems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gems
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.1.2
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Library manages pre-compiled Lambda Gems for Jets Ruby Serverless Framework
|