Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
f2db4c2
add dummy runtime2 directory structure
mdrohmann Feb 8, 2021
2d71690
runtime2 draft
mdrohmann Feb 11, 2021
039055f
make a little clearer where the message handler would be used
mdrohmann Feb 11, 2021
7cb7b22
remove interface use in implementations
mdrohmann Feb 11, 2021
65da352
rename api -> model
mdrohmann Feb 11, 2021
f255dba
remove NewRuntime function
mdrohmann Feb 11, 2021
96f6aad
simplify package structure
mdrohmann Feb 11, 2021
ce05380
small "fixes"
mdrohmann Feb 11, 2021
fa2b4e3
doc.go -> ARCHITECTURE.md
mdrohmann Feb 11, 2021
7f5cf78
integrate David's changes
mdrohmann Feb 16, 2021
313926e
changes from meeting
mdrohmann Feb 17, 2021
39b15a8
Merge pull request #1252 from ActiveState/martind/runtime-refactor-17…
mdrohmann Feb 17, 2021
d83b310
add test for artifact setup orchestration
mdrohmann Feb 18, 2021
a042701
add scheduler test
mdrohmann Feb 18, 2021
92428e2
outline more tests
mdrohmann Feb 18, 2021
7e18dad
add one more test
mdrohmann Feb 18, 2021
5b7dc78
add the default model
mdrohmann Feb 19, 2021
cc9fb5c
add some useful unit tests
mdrohmann Feb 19, 2021
27b6339
implement EnvironProvider for alternative builds
mdrohmann Feb 19, 2021
e6756cf
add some testhelper files
mdrohmann Feb 20, 2021
96f602e
add Artifact and ArtifactChanges and test them
mdrohmann Feb 20, 2021
6e590fb
Merge pull request #1260 from ActiveState/martind/runtime-tests-17696…
mdrohmann Feb 20, 2021
51de300
Merge pull request #1262 from ActiveState/martind/runtime-model-17696…
mdrohmann Feb 20, 2021
92624a2
Merge pull request #1264 from ActiveState/martind/runtime-load-176968032
mdrohmann Feb 20, 2021
52b9cc6
Restructure runtime2
Naatan Feb 24, 2021
16b37f9
Replace orchestrator with workerpool package
Naatan Feb 25, 2021
70cb9d5
Refactored artifact specific logic
Naatan Mar 1, 2021
c279bd6
Implemented runtime setup (camel and messaging still missing)
Naatan Mar 5, 2021
d17d1ac
Merge pull request #1271 from ActiveState/pr/176968106
Naatan Mar 8, 2021
f79d32d
Merge pull request #1274 from ActiveState/pr/176968106b
Naatan Mar 8, 2021
79ac553
perl-5.32 activates
mdrohmann Mar 10, 2021
416aac2
add download event
mdrohmann Mar 10, 2021
689ef9d
update labels during setup failure
mdrohmann Mar 10, 2021
b6b15cc
fix tests
mdrohmann Mar 10, 2021
b85dcf1
fix integration test
mdrohmann Mar 10, 2021
898c701
remove temporary installation directory
mdrohmann Mar 10, 2021
1b070cd
merge environment definition files in the correct order
mdrohmann Mar 10, 2021
711302a
fix a comment
mdrohmann Mar 10, 2021
95698d6
close connection outside of buildlog
mdrohmann Mar 10, 2021
a520bc8
sign URI in download function
mdrohmann Mar 10, 2021
a012571
move analytics definitions to internal package
mdrohmann Mar 11, 2021
4037724
add type alias
mdrohmann Mar 11, 2021
d48573e
UpdateEnviron() args are more explicit
mdrohmann Mar 11, 2021
d860eda
remove noSetupYet argument
mdrohmann Mar 11, 2021
5d45cb1
add unit test for updateEnviron
mdrohmann Mar 12, 2021
708a864
forgot to add the test file
mdrohmann Mar 12, 2021
9302090
Merge pull request #1282 from ActiveState/martind/refactor-finish-177…
mdrohmann Mar 12, 2021
671fd7f
Merge remote-tracking branch 'origin/runtime-refactor' into martind/e…
mdrohmann Mar 12, 2021
c379891
Merge pull request #1283 from ActiveState/martind/env-def-merge-17721…
mdrohmann Mar 12, 2021
c844e85
add camel artifact setup implementation
mdrohmann Mar 16, 2021
a2eac17
remove unused Setuper
mdrohmann Mar 16, 2021
80da5a4
copy missing file
mdrohmann Mar 16, 2021
2997d4e
fix path to assets directory
mdrohmann Mar 16, 2021
76452ca
fix arguments
mdrohmann Mar 16, 2021
6a8fa30
remove unused function
mdrohmann Mar 16, 2021
70dd631
fix unit tests
mdrohmann Mar 16, 2021
f276e42
fix two error messages
mdrohmann Mar 16, 2021
86d5bd9
handle needs update error in deploy runner
mdrohmann Mar 16, 2021
763b9e0
fix relocation (!!!!)
mdrohmann Mar 17, 2021
72a6d67
fix unit tests
mdrohmann Mar 17, 2021
b005ac0
fix deploy integration tests
mdrohmann Mar 17, 2021
3618bf8
anonymouse packages command use runtime2
mdrohmann Mar 17, 2021
e399387
make deploy_int_test pass
mdrohmann Mar 17, 2021
b29c8e9
fix TestEnv
mdrohmann Mar 17, 2021
ed8043f
remove caching used for development
mdrohmann Mar 17, 2021
96bed9f
fix path to metadata.json file
mdrohmann Mar 17, 2021
da0dd28
cleanup
mdrohmann Mar 17, 2021
0374cd8
Revert "remove caching used for development"
mdrohmann Mar 17, 2021
155b393
cleanup
mdrohmann Mar 18, 2021
04069ce
add debug flag to carlisle test
mdrohmann Mar 18, 2021
61edf9b
take a shot at the Mac installation
mdrohmann Mar 18, 2021
bf7d535
remove empty variables from envdef
mdrohmann Mar 18, 2021
9105b18
just an idea: envdef variables can prefer os choice
mdrohmann Mar 18, 2021
ab48acb
just an idea: usablePath ignores targetPath in deploy
mdrohmann Mar 18, 2021
d0dbf2d
Revert "just an idea: usablePath ignores targetPath in deploy"
mdrohmann Mar 18, 2021
eb0380c
Revert "just an idea: envdef variables can prefer os choice"
mdrohmann Mar 18, 2021
1e77800
fix prepare_mac_test
mdrohmann Mar 18, 2021
a76d909
make directory path absolute in targetedrelocation conversion
mdrohmann Mar 18, 2021
ffd0799
remove caching used for development
mdrohmann Mar 17, 2021
6abd4a5
fix typo
mdrohmann Mar 18, 2021
b57d3f6
cleanup
mdrohmann Mar 18, 2021
cbaa276
remove InstallerExtension()
mdrohmann Mar 18, 2021
e94b746
move injectProjectDir to legacy.go
mdrohmann Mar 18, 2021
2673cd2
:face-palm:
mdrohmann Mar 18, 2021
0fc1053
fix separate binaries logic in file transforms
mdrohmann Mar 18, 2021
dbb5464
test the correct package!
mdrohmann Mar 18, 2021
5170e0f
add a follow-up story
mdrohmann Mar 18, 2021
444391e
revert changes in pkg/platform/runtime/
mdrohmann Mar 18, 2021
0dd5aca
fix another test case
mdrohmann Mar 18, 2021
ab9796a
remove old runtime implementation
mdrohmann Mar 19, 2021
e693533
Merge pull request #1288 from ActiveState/martind/camel-runtime-17696…
mdrohmann Mar 19, 2021
e66ad56
rename runtime2 -> runtime
mdrohmann Mar 19, 2021
baeeaf6
add runtime msg handler
mdrohmann Mar 24, 2021
e18f09d
add accidentally deleted files
mdrohmann Mar 24, 2021
31337b2
fix build log test
mdrohmann Mar 24, 2021
acf5a99
resolve artifact dependencies in recipe
mdrohmann Mar 24, 2021
e902665
add changeSummary message
mdrohmann Mar 24, 2021
2693efb
fix total artifacts reporting for camel builds
mdrohmann Mar 24, 2021
1f9a9b4
update integration tests
mdrohmann Mar 24, 2021
7d8d2a8
update go-funk
mdrohmann Mar 24, 2021
b65a942
trim progress bar decor names to maxWidth based on terminal size
mdrohmann Mar 24, 2021
1fd9872
call mpb.Wait() in runtimemsg handler to clean up all resources
mdrohmann Mar 24, 2021
b1f2e35
fix change summary message
mdrohmann Mar 24, 2021
32b9f09
add short doc string
mdrohmann Mar 24, 2021
2896465
add doc string to SubProgressProducer
mdrohmann Mar 24, 2021
29ad524
subprogress -> incremental progress
mdrohmann Mar 24, 2021
8267277
be more cautious about reported artifact ids
mdrohmann Mar 24, 2021
5ffedb1
remove TODO message
mdrohmann Mar 24, 2021
54cae8b
allow build dependencies for bundles
mdrohmann Mar 24, 2021
7723f05
fix events consumer test
mdrohmann Mar 24, 2021
3b9cdfa
proxy-reader needs to support ReadAt to support zip extractions. :(
mdrohmann Mar 24, 2021
7ff6d98
fix error message
mdrohmann Mar 25, 2021
3a1747e
simplify channel handling a little
mdrohmann Mar 25, 2021
745fb3e
Merge pull request #1290 from ActiveState/martind/cleanup-176968116
mdrohmann Mar 25, 2021
7c5f46b
move progress-demo to scripts
mdrohmann Mar 25, 2021
a963fca
move proxyreader
mdrohmann Mar 25, 2021
7654c49
move progressbar to own directory
mdrohmann Mar 25, 2021
241f671
do not print progress bar when output != plain
mdrohmann Mar 25, 2021
201e093
make progress bars less jumpy by fixing their widths
mdrohmann Mar 25, 2021
df6ec39
rename ProgressBar -> RuntimeProgress
mdrohmann Mar 25, 2021
089bb5a
fix consumer_test
mdrohmann Mar 25, 2021
781d7ca
always delete camel installation directory
mdrohmann Mar 26, 2021
bf6c437
store recipe file!!!
mdrohmann Mar 26, 2021
0c8da7c
remove unpacked dir before unpacking
mdrohmann Mar 26, 2021
ffed907
camel downloads are called bundle (not unknown)
mdrohmann Mar 26, 2021
0e5fb35
synchronize the file move operation
mdrohmann Mar 25, 2021
a76b6c6
improve error reporting
mdrohmann Mar 26, 2021
2ca464c
simplify worker pool submit code
mdrohmann Mar 26, 2021
2f2069a
use mainthread library for synchronization
mdrohmann Mar 29, 2021
0d18768
comment on bundle name
mdrohmann Mar 29, 2021
54d0885
collect artifact errors in channel
mdrohmann Mar 29, 2021
cfe3da0
close channel in right place
mdrohmann Mar 29, 2021
074315b
add aggregateErrors function
mdrohmann Mar 29, 2021
57781e5
move mainthread down the stack one step
mdrohmann Mar 30, 2021
d5beb42
some refactoring
mdrohmann Mar 29, 2021
f2b69ae
add localization, docs and simplify decor.go
mdrohmann Mar 30, 2021
2bc400e
change unit decor
mdrohmann Mar 30, 2021
398938a
fix decor width of progress counters
mdrohmann Mar 31, 2021
bc53ab7
fix potential panic on closed channel
mdrohmann Mar 31, 2021
03e88a9
move camel specific switches out of setup.go
mdrohmann Mar 31, 2021
99751ea
add comment about extra wait group
mdrohmann Mar 31, 2021
7b82bb6
rename messageHandler -> events
mdrohmann Mar 31, 2021
2228d44
rename HandleEvents -> WaitForAllEvents
mdrohmann Mar 31, 2021
040639d
fix unit test
mdrohmann Mar 31, 2021
b80f9e2
Merge pull request #1291 from ActiveState/martind/msghandler-176968116
mdrohmann Mar 31, 2021
64dc414
Merge remote-tracking branch 'origin/runtime-refactor' into martind/s…
mdrohmann Mar 31, 2021
6438b40
Merge pull request #1292 from ActiveState/martind/sync-file-move-1774…
mdrohmann Mar 31, 2021
5f8c2c7
Merge remote-tracking branch 'origin/master' into runtime-refactor
mdrohmann Apr 1, 2021
f4b3377
fix deploy runner
mdrohmann Apr 1, 2021
b5c23a3
rename RuntimeMessageHandler -> RuntimeEventsHandler
mdrohmann Apr 1, 2021
e2f7cd3
update runbits.RefreshRuntime
mdrohmann Apr 1, 2021
c4c9cb8
add changelog
mdrohmann Apr 1, 2021
e94d0b4
update ARCHITECTURE.md file
mdrohmann Apr 1, 2021
5ee31a2
add missing file
mdrohmann Apr 1, 2021
112f655
fix unit test
mdrohmann Apr 1, 2021
d43d37f
Merge branch 'master' into runtime-refactor
Naatan Apr 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build
/build/
debug
debug.test
internal/constants/generated.go
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.28.0

### Changed

- New runtimes are installed in parallel and 2-4 times faster.
([PR #1275](https://github.com/ActiveState/cli/pull/1275))

### Fixed

- `state push` updates project name in activestate.yaml.
Expand Down
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ require (
github.com/dave/jennifer v0.18.0
github.com/denisbrodbeck/machineid v0.8.0
github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 // indirect
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
github.com/fatih/color v1.7.0
github.com/felixge/fgprof v0.9.0
github.com/fsnotify/fsnotify v1.4.7
github.com/gammazero/workerpool v1.1.1
github.com/getlantern/systray v1.1.0
github.com/go-ini/ini v1.32.0 // indirect
github.com/go-ole/go-ole v1.2.4
Expand Down Expand Up @@ -60,7 +62,7 @@ require (
github.com/mailru/easyjson v0.0.0-20180323154445-8b799c424f57 // indirect
github.com/mash/go-tempfile-suffix v0.0.0-20150731093933-48f0f8a3a5ab
github.com/matryer/is v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.4
github.com/mattn/go-runewidth v0.0.10
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/go-wordwrap v1.0.0
github.com/nicksnyder/go-i18n v1.10.0
Expand All @@ -79,14 +81,14 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.6.2-0.20201103103935-92707c0b2d50
github.com/thoas/go-funk v0.0.0-20170604141201-14304e8530de
github.com/thoas/go-funk v0.8.0
github.com/ulikunitz/xz v0.5.4 // indirect
github.com/vbauerster/mpb/v4 v4.10.0
github.com/vbauerster/mpb/v6 v6.0.2
github.com/vektah/gqlparser/v2 v2.1.0
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/net v0.0.0-20201021035429-f5854403a974
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
golang.org/x/text v0.3.3
google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70
google.golang.org/grpc v1.36.0 // indirect
Expand Down
28 changes: 19 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0=
github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs=
Expand Down Expand Up @@ -140,6 +142,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 h1:baVdMKlASEHrj19iqjARrPbaRisD7EuZEVJj6ZMLl1Q=
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3/go.mod h1:VEPNJUlxl5KdWjDvz6Q1l+rJlxF2i6xqDeGuGAxa87M=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/felixge/fgprof v0.9.0 h1:1Unx04fyC3gn3RMH/GuwUF1UdlulLMpJV13jr9SOHvs=
Expand All @@ -148,6 +152,10 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gammazero/deque v0.0.0-20200721202602-07291166fe33 h1:UG4wNrJX9xSKnm/Gck5yTbxnOhpNleuE4MQRdmcGySo=
github.com/gammazero/deque v0.0.0-20200721202602-07291166fe33/go.mod h1:D90+MBHVc9Sk1lJAbEVgws0eYEurY4mv2TDso3Nxh3w=
github.com/gammazero/workerpool v1.1.1 h1:MN29GcZtZZAgzTU+Zk54Y+J9XkE54MoXON/NCZvNulo=
github.com/gammazero/workerpool v1.1.1/go.mod h1:5BN0IJVRjSFAypo9QTJCaWdijjNz9Jjl6VFS1PRjCeg=
github.com/gdamore/encoding v0.0.0-20151215212835-b23993cbb635/go.mod h1:yrQYJKKDTrHmbYxI7CYi+/hbdiDT2m4Hj+t0ikCjsrQ=
github.com/gdamore/tcell v1.0.1-0.20180608172421-b3cebc399d6f/go.mod h1:tqyG50u7+Ctv1w5VX67kLzKcj9YXR/JSBZQq/+mLl1A=
github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 h1:NRUJuo3v3WGC/g5YiyF790gut6oQr5f3FBI88Wv0dx4=
Expand Down Expand Up @@ -371,8 +379,8 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
Expand Down Expand Up @@ -431,6 +439,9 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rollbar/rollbar-go v1.1.0 h1:3ysiHp3ep8W50ykgBMCKXJGaK2Jdivru7SW9EYfAo+M=
Expand Down Expand Up @@ -484,8 +495,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.6.2-0.20201103103935-92707c0b2d50 h1:aQdElrdadJZjGar4PipPBSpVh3yyDIuDSaM5PbMn6o8=
github.com/stretchr/testify v1.6.2-0.20201103103935-92707c0b2d50/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/thoas/go-funk v0.0.0-20170604141201-14304e8530de h1:e96987R6uGe5Rr9oAjSwm27e6tRObx8wON4uJUhK6Uk=
github.com/thoas/go-funk v0.0.0-20170604141201-14304e8530de/go.mod h1:mlR+dHGb+4YgXkf13rkQTuzrneeHANxOm6+ZnEV9HsA=
github.com/thoas/go-funk v0.8.0 h1:JP9tKSvnpFVclYgDM0Is7FD9M4fhPvqA0s0BsXmzSRQ=
github.com/thoas/go-funk v0.8.0/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ulikunitz/xz v0.5.4 h1:zATC2OoZ8H1TZll3FpbX+ikwmadbO699PE06cIkm9oU=
github.com/ulikunitz/xz v0.5.4/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
Expand All @@ -495,8 +506,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vbauerster/mpb/v4 v4.10.0 h1:u+Yud9Slhetz5F3Ysoso5hUguWjvfrtxVX3Xdxx9N+o=
github.com/vbauerster/mpb/v4 v4.10.0/go.mod h1:fRf6o5qdKuPqMX+2Pk99O/XSnyXDKScHzEkW72E6Sio=
github.com/vbauerster/mpb/v6 v6.0.2 h1:DWFnBOcgHi9GUNduC1MbQ936Z7B77wvOnZexP9Hjzcw=
github.com/vbauerster/mpb/v6 v6.0.2/go.mod h1:JDNVbdx4oAMMxZNXodDH2DeDY5xBJC8bDGHNFZwRqQM=
github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U=
github.com/vektah/gqlparser/v2 v2.1.0 h1:uiKJ+T5HMGGQM2kRKQ8Pxw8+Zq9qhhZhz/lieYvCMns=
github.com/vektah/gqlparser/v2 v2.1.0/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms=
Expand Down Expand Up @@ -525,7 +536,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200427165652-729f1e841bcc/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down Expand Up @@ -626,7 +636,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -650,8 +659,9 @@ golang.org/x/sys v0.0.0-20200821140526-fda516888d29/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
27 changes: 27 additions & 0 deletions internal/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,33 @@ const CatRunCmd = "run-command"
// CatBuild is the event category used for headchef builds
const CatBuild = "build"

// CatRuntime is the event category used for all runtime setup and usage
const CatRuntime = "runtime"

// ActRuntimeStart is the event action sent when creating a runtime
const ActRuntimeStart = "start"

// ActRuntimeCache is the event action sent when a runtime is constructed from the local cache alone
const ActRuntimeCache = "cache"

// ActRuntimeBuild is the event action sent when starting a remote build for the project
const ActRuntimeBuild = "build"

// ActRuntimeDownload is the event action sent before starting the download of artifacts for a runtime
const ActRuntimeDownload = "download"

// ActRuntimeSuccess is the event action sent when a runtime's environment has been successfully computed (for the first time)
const ActRuntimeSuccess = "success"

// ActRuntimeFailure is the event action sent when a failure occurred anytime during a runtime operation
const ActRuntimeFailure = "failure"

// LblRtFailUpdate is the label sent with an ActRuntimeFailure event if an error occurred during a runtime update
const LblRtFailUpdate = "update"

// LblRtFailEnv is the label sent with an ActRuntimeFailure event if an error occurred during the resolution of the runtime environment
const LblRtFailEnv = "env"

// CatPpmConversion is the event category used for ppm-conversion events
const CatPpmConversion = "ppm-conversion"

Expand Down
20 changes: 14 additions & 6 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ const ArtifactArchiveName = "artifact.tar.gz"
// ArtifactCacheFileName is the standardized name of an artifact cache file
const ArtifactCacheFileName = "artifact_cache.json"

// ArtifactMetaDir is the directory in which we store meta information about artifacts
const ArtifactMetaDir = "artifacts"

// DefaultNamespaceDomain is the domain used when no namespace is given and one has to be constructed
const DefaultNamespaceDomain = "github.com"

Expand Down Expand Up @@ -204,21 +207,26 @@ const ActivePythonDistsDir = "python"
const RuntimeInstallDirs = "INSTALLDIR,perl"

// RuntimeMetaFile is the json file that holds meta information about our runtime
const RuntimeMetaFile = "support/metadata.json"
const RuntimeMetaFile = "metadata.json"

// RuntimeDefinitionFilename is the filename for runtime meta data bundled with artifacts, if they are built by the alternative builder
const RuntimeDefinitionFilename = "runtime.json"

// LocalRuntimeEnvironmentDirectory is the directory (relative to the installation of a runtime build) where runtime definition files are stored
const LocalRuntimeEnvironmentDirectory = "_runtime_env"
const LocalRuntimeEnvironmentDirectory = "_runtime_store"

// LocalRuntimeTempDirectory is the directory (relative to the installation of a runtime build) where temp files are stored
const LocalRuntimeTempDirectory = "_runtime_temp"

// RuntimeInstallationCompleteMarker is created after all artifacts have been installed
// Check for existence of this file to ensure that the installation has not been interrupted prematurely.
const RuntimeInstallationCompleteMarker = "support/completed"
const RuntimeInstallationCompleteMarker = "completed"

// RuntimeBuildEngineStore is created after all artifacts have been installed
// Check for existence of this file to ensure that the installation has not been interrupted prematurely.
const RuntimeBuildEngineStore = "support/build_engine"
// RuntimeBuildEngineStore contains the name of the build engine that was used to create this runtime
const RuntimeBuildEngineStore = "build_engine"

// RuntimeRecipeStore contains a serialization of the recipe used to create this build
const RuntimeRecipeStore = "recipe"

// StateToolMarketingPage links to the marketing page for the state tool
const StateToolMarketingPage = "https://www.activestate.com/products/platform/state-tool/"
Expand Down
39 changes: 17 additions & 22 deletions internal/download/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ import (
"github.com/ActiveState/cli/internal/errs"
"github.com/ActiveState/cli/internal/locale"
"github.com/ActiveState/cli/internal/logging"
"github.com/ActiveState/cli/internal/progress"
"github.com/ActiveState/cli/internal/retryhttp"
"github.com/ActiveState/cli/internal/proxyreader"
)

// Get takes a URL and returns the contents as bytes
var Get func(url string) ([]byte, error)

type DownloadProgress interface {
TotalSize(int)
IncrBy(int)
}

// GetWithProgress takes a URL and returns the contents as bytes, it takes an optional second arg which will spawn a progressbar
var GetWithProgress func(url string, progress *progress.Progress) ([]byte, error)
var GetWithProgress func(url string, progress DownloadProgress) ([]byte, error)

func init() {
SetMocking(condition.InTest())
Expand All @@ -44,11 +49,11 @@ func httpGet(url string) ([]byte, error) {
return httpGetWithProgress(url, nil)
}

func httpGetWithProgress(url string, progress *progress.Progress) ([]byte, error) {
func httpGetWithProgress(url string, progress DownloadProgress) ([]byte, error) {
return httpGetWithProgressRetry(url, progress, 1, 3)
}

func httpGetWithProgressRetry(url string, progress *progress.Progress, attempt int, retries int) ([]byte, error) {
func httpGetWithProgressRetry(url string, prg DownloadProgress, attempt int, retries int) ([]byte, error) {
logging.Debug("Retrieving url: %s, attempt: %d", url, attempt)
client := retryhttp.NewClient(0 /* 0 = no timeout */, retries)
resp, err := client.Get(url)
Expand Down Expand Up @@ -77,38 +82,28 @@ func httpGetWithProgressRetry(url string, progress *progress.Progress, attempt i
}
}

bar := progress.AddByteProgressBar(int64(total))
var src io.Reader = resp.Body
defer resp.Body.Close()

// Ensure bar is always closed (especially for retries)
defer func() {
if !bar.Completed() {
bar.Abort(true)
}
}()
if prg != nil {
prg.TotalSize(total)
src = proxyreader.NewProxyReader(prg, resp.Body)
}

src := resp.Body
var dst bytes.Buffer

src = bar.ProxyReader(resp.Body)

_, err = io.Copy(&dst, src)
if err != nil {
logging.Debug("Reading body failed: %s", err)
if attempt <= retries {
return httpGetWithProgressRetry(url, progress, attempt+1, retries)
return httpGetWithProgressRetry(url, prg, attempt+1, retries)
}
return nil, errs.Wrap(err, "Could not copy network stream")
}

if !bar.Completed() {
// Failsafe, so we don't get blocked by a progressbar
bar.IncrBy(total)
}

return dst.Bytes(), nil
}

func _testHTTPGetWithProgress(url string, progress *progress.Progress) ([]byte, error) {
func _testHTTPGetWithProgress(url string, progress DownloadProgress) ([]byte, error) {
return _testHTTPGet(url)
}

Expand Down
Loading