Add Dockerfile for running test #1736

Merged
PeterSurda merged 1 commits from dockertest into v0.6 2021-02-17 09:45:06 +01:00
PeterSurda commented 2021-02-15 09:22:19 +01:00 (Migrated from github.com)
  • run ./run-tests-in-docker.sh to run travis tests locally
- run `./run-tests-in-docker.sh` to run travis tests locally
g1itch commented 2021-02-15 13:26:43 +01:00 (Migrated from github.com)

I'm checking the ./run-tests-in-docker.sh. I hope it downloads less than 6 Gb (: Did you try to do RUN apt-get update once, e.g.:

FROM ubuntu:bionic AS pybm-travis-bionic
ENV DEBIAN_FRONTEND noninteractive
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
I'm checking the `./run-tests-in-docker.sh`. I hope it downloads less than 6 Gb (: Did you try to do `RUN apt-get update` once, e.g.: ``` FROM ubuntu:bionic AS pybm-travis-bionic ENV DEBIAN_FRONTEND noninteractive RUN add-apt-repository ppa:deadsnakes/ppa RUN apt-get update ```
g1itch commented 2021-02-15 14:12:24 +01:00 (Migrated from github.com)

Also I'm not sure about python-pycryptopp, where it's used.

Also I'm not sure about `python-pycryptopp`, where it's used.
PeterSurda commented 2021-02-15 14:15:00 +01:00 (Migrated from github.com)

I'll test the changes you asked about.

I'll test the changes you asked about.
g1itch commented 2021-02-15 14:38:21 +01:00 (Migrated from github.com)

apt-get seems to install an old python-psutil: https://buildbot.bitmessage.org/#/builders/22/builds/6/steps/7/logs/stdio

apt-get seems to install an old python-psutil: https://buildbot.bitmessage.org/#/builders/22/builds/6/steps/7/logs/stdio
g1itch commented 2021-02-15 15:57:27 +01:00 (Migrated from github.com)

Maybe use useradd, not adduser? It produces this:

Copying files from `/etc/skel' ...
Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error
passwd: password unchanged
Use of uninitialized value $answer in chop at /usr/sbin/adduser line 591.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 592.
Try again? [y/N] Changing the user information for builder
Enter the new value, or press ENTER for the default
	Full Name []: 	Room Number []: 	Work Phone []: 	Home Phone []: Other []: Use of uninitialized value $answer in chop at /usr/sbin/adduser line 621.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 622.
Is the information correct? [Y/n]
Maybe use useradd, not adduser? It produces this: ``` Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error passwd: password unchanged Use of uninitialized value $answer in chop at /usr/sbin/adduser line 591. Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 592. Try again? [y/N] Changing the user information for builder Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Use of uninitialized value $answer in chop at /usr/sbin/adduser line 621. Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 622. Is the information correct? [Y/n] ```
g1itch (Migrated from github.com) reviewed 2021-02-15 16:17:15 +01:00
@ -0,0 +51,4 @@
# copy sources
COPY . /home/builder/src
RUN chown -R builder.builder /home/builder/src
g1itch (Migrated from github.com) commented 2021-02-15 16:17:15 +01:00

Strange. man chown says chown [OPTION]... [OWNER][:[GROUP]] FILE...

Strange. `man chown` says `chown [OPTION]... [OWNER][:[GROUP]] FILE...`
g1itch commented 2021-02-15 16:20:42 +01:00 (Migrated from github.com)
Another apt update ): https://git.bitmessage.org/Bitmessage/buildbot-scripts/src/branch/master/travis2bash.sh#L69
g1itch (Migrated from github.com) approved these changes 2021-02-15 16:32:56 +01:00
g1itch (Migrated from github.com) left a comment

It works!

It works!
PeterSurda commented 2021-02-15 17:05:34 +01:00 (Migrated from github.com)

I can add some conditional for skipping redundancies, I can't just remove them because in some jobs / situations they are needed, the same travis2bash.sh script is used in VMs, in docker, inside and outside of buildbot, and the environments differ.

I can add some conditional for skipping redundancies, I can't just remove them because in some jobs / situations they are needed, the same `travis2bash.sh` script is used in VMs, in docker, inside and outside of buildbot, and the environments differ.
PeterSurda (Migrated from github.com) reviewed 2021-02-15 17:09:04 +01:00
@ -0,0 +51,4 @@
# copy sources
COPY . /home/builder/src
RUN chown -R builder.builder /home/builder/src
PeterSurda (Migrated from github.com) commented 2021-02-15 17:09:04 +01:00

I think OWNER.GROUP is a GNU non-POSIX feature, maybe it doesn't work on BSD, I've been using it on linux since the '90s. But I can change it, no big deal.

I think OWNER.GROUP is a GNU non-POSIX feature, maybe it doesn't work on BSD, I've been using it on linux since the '90s. But I can change it, no big deal.
PeterSurda commented 2021-02-16 10:13:47 +01:00 (Migrated from github.com)
  • only one apt update in total now
  • use POSIX arguments for chown
  • only call apt install ~once~ twice inside Dockerfile.travis
  • use useradd instead of adduser
  • remove python-pycryptopp
- only one `apt update` in total now - use POSIX arguments for chown - only call `apt install` ~once~ twice inside `Dockerfile.travis` - use `useradd` instead of `adduser` - remove `python-pycryptopp`
This repo is archived. You cannot comment on pull requests.
No description provided.