Skip to content

Use docker for local development#63

Closed
aledbf wants to merge 1 commit into
denoland:masterfrom
aledbf:docker-dev-env
Closed

Use docker for local development#63
aledbf wants to merge 1 commit into
denoland:masterfrom
aledbf:docker-dev-env

Conversation

@aledbf

@aledbf aledbf commented Jun 1, 2018

Copy link
Copy Markdown
$ DOCKER_DEV_IMAGE=aledbf/deno:dev-image-0.1 make docker-dev

This is the output of the build https://gist.github.com/aledbf/f39189a7e7ea3beff7aee676d85e5c51

After this running make run <makefile task> we can run any task inside a container:

$ make run deno
yarn
yarn install v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 21.97s.
./node_modules/.bin/pbjs -t static-module -w commonjs -o msg.pb.js msg.proto
./node_modules/.bin/pbts -o msg.pb.d.ts msg.pb.js
./node_modules/.bin/tsc --noEmit # Only for type checking.
./node_modules/.bin/parcel build --out-dir=dist/ --log-level=1 --no-minify main.ts
cp node_modules/typescript/lib/*d.ts dist/
cp deno.d.ts dist/
go-bindata -pkg deno -o assets.go dist/
go build -o deno ./cmd
make: 'deno' is up to date.
$ make run test
go test -v
=== RUN   TestLoadOutputCodeCache
--- PASS: TestLoadOutputCodeCache (0.00s)
=== RUN   TestIntegrationFiles
=== RUN   TestIntegrationFiles/001_hello.js.out
=== RUN   TestIntegrationFiles/002_hello.ts.out
=== RUN   TestIntegrationFiles/003_relative_import.ts.out
=== RUN   TestIntegrationFiles/004_set_timeout.ts.out
=== RUN   TestIntegrationFiles/005_more_imports.ts.out
=== RUN   TestIntegrationFiles/006_url_imports.ts.out
=== RUN   TestIntegrationFiles/009_pub_sub.ts.out
=== RUN   TestIntegrationFiles/010_set_interval.ts.out
=== RUN   TestIntegrationFiles/012_async.ts.out
=== RUN   TestIntegrationFiles/async_error.ts.out
=== RUN   TestIntegrationFiles/error.ts.out
=== RUN   TestIntegrationFiles/import_typescript.ts.out
--- FAIL: TestIntegrationFiles (15.70s)
    --- PASS: TestIntegrationFiles/001_hello.js.out (1.06s)
    --- PASS: TestIntegrationFiles/002_hello.ts.out (1.05s)
    --- PASS: TestIntegrationFiles/003_relative_import.ts.out (1.13s)
    --- PASS: TestIntegrationFiles/004_set_timeout.ts.out (1.06s)
    --- PASS: TestIntegrationFiles/005_more_imports.ts.out (1.26s)
    --- PASS: TestIntegrationFiles/006_url_imports.ts.out (1.12s)
    --- FAIL: TestIntegrationFiles/009_pub_sub.ts.out (2.03s)
    	integration_test.go:61: Expected success exit status 1
    --- PASS: TestIntegrationFiles/010_set_interval.ts.out (1.60s)
    --- PASS: TestIntegrationFiles/012_async.ts.out (1.21s)
    --- PASS: TestIntegrationFiles/async_error.ts.out (1.08s)
    --- PASS: TestIntegrationFiles/error.ts.out (2.00s)
    --- PASS: TestIntegrationFiles/import_typescript.ts.out (1.11s)
=== RUN   TestIntegrationUrlArgs
good cacheFn /tmp/TestIntegration387570343/src/localhost:4545/testdata/001_hello.js
bad cacheFn /tmp/TestIntegration271357914/src/localhost:4546/testdata/001_hello.js
--- PASS: TestIntegrationUrlArgs (2.41s)
=== RUN   TestTestsTs
1/4 +0 -0: tests_test
2/4 +1 -0: tests_fetch
3/4 +2 -0: tests_readFileSync
deno_1.readFileSync is not a function TypeError: deno_1.readFileSync is not a function
    at tests_readFileSync (/go/src/github.com/ry/deno/tests.ts:13:27)
    at Object.runTests [as cb] (/go/src/github.com/ry/deno/testing/testing.ts:62:23)
--- FAIL: TestTestsTs (0.60s)
	integration_test.go:146: exit status 1
=== RUN   TestResolveModule1
--- PASS: TestResolveModule1 (0.00s)
=== RUN   TestResolveModule2
--- PASS: TestResolveModule2 (0.00s)
=== RUN   TestResolveModule3
--- PASS: TestResolveModule3 (0.00s)
=== RUN   TestResolveModule4
--- PASS: TestResolveModule4 (0.00s)
=== RUN   TestResolveModuleExtensionsAintSpecial
--- PASS: TestResolveModuleExtensionsAintSpecial (0.00s)
=== RUN   TestPatternMatch
--- PASS: TestPatternMatch (0.00s)
=== RUN   TestPatternMatchStackTrace
--- PASS: TestPatternMatchStackTrace (0.00s)
FAIL
exit status 1
FAIL	github.com/ry/deno	18.705s
Makefile:79: recipe for target 'test' failed
make: *** [test] Error 1
Makefile:95: recipe for target 'run' failed
make: *** [run] Error 2
$ ldd deno
	linux-vdso.so.1 (0x00007ffcca0f9000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb3de490000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb3de102000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb3ddd64000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb3ddb4c000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb3dd75b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fb3de6af000)
$ ./deno testdata/001_hello.js
Hello World

This is similar to https://github.com/ry/deno/pull/16

@aledbf

aledbf commented Jun 1, 2018

Copy link
Copy Markdown
Author
REPOSITORY         TAG                       IMAGE ID            CREATED           SIZE
aledbf/deno       dev-image-0.1             984c21235687        24 minutes ago    2.91GB

@mohsen1

mohsen1 commented Jun 1, 2018

Copy link
Copy Markdown
Contributor

Thanks for doing this! Can you setup TravisCI in your fork to publish to Docker Hub and run test with Docker so we know its working end-to-end?

Comment thread Makefile Outdated
go test -v


DOCKER_DEV_IMAGE ?= ry/deno:dev-image-0.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you become the owner of this image in Docker Hub then can you change the owner? I wish you were using TravisCI TRAVIS_REPO_SLUG instead

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this allows you to use custom build and publish that to any repo (maybe a private registry) and only the user ry can push this image to docker hub.

Not sure what's the intention here:

  • use a container to run the tests in CI
  • publish the docker image
  • both

From my use case, I just want a reproducible way to build deno without polluting my machine with all these dependencies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing a "dev" image to Dockerhub and using the published image to run the test would be ideal. Thanks to Docker layering it will speed up test runs a lot.

https://docs.travis-ci.com/user/build-stages/share-docker-image/

Typically on each release (git tag) on master we want to update the primary docker image in Dockerhub.

@maxmcd maxmcd mentioned this pull request Jun 1, 2018
@aledbf
aledbf force-pushed the docker-dev-env branch 14 times, most recently from b9fe034 to 881a031 Compare June 2, 2018 02:05
@maxmcd

maxmcd commented Jun 3, 2018

Copy link
Copy Markdown

Other than the availability of the image for pulling, is there a real reason to involve the registry here? Wouldn't it make sense to just swap out the current build steps with a docker image build step?

@mohsen1

mohsen1 commented Jun 4, 2018

Copy link
Copy Markdown
Contributor

@maxmcd TravisCI docs suggests this so you can run multiple test tasks in parallel.

@V-Tom

V-Tom commented Jun 6, 2018

Copy link
Copy Markdown

Excuse me, Does this Docker image stable for use since now yet?

@maxmcd

maxmcd commented Jun 6, 2018

Copy link
Copy Markdown

@V-Tom I turned my PR #95 into an independent repo: maxmcd/deno-docker

The images are a bit smaller and there's a slim build for standalone use.

@ry

ry commented Jun 22, 2018

Copy link
Copy Markdown
Member

I'd be interested to know if this can work with the current build? Sorry for coding past this - but it's now out of date and I will close.
Thanks for the effort @aledbf

@ry ry closed this Jun 22, 2018
piscisaureus pushed a commit to piscisaureus/deno that referenced this pull request Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants