Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile for dendrite #541

Merged
merged 17 commits into from Apr 4, 2019

Conversation

Projects
None yet
2 participants
@anoadragon453
Copy link
Member

commented Jan 16, 2019

Adds a Dockerfile for Dendrite which prepares postgres and installs the needed dependencies for sytest and dendrite to run.

@anoadragon453 anoadragon453 force-pushed the anoa/dendrite_dockerfile branch from 1c06631 to 17edf0f Jan 17, 2019

@anoadragon453

This comment has been minimized.

Copy link
Member Author

commented Jan 17, 2019

Not sure why adding two unrelated files would cause the tests to fail...

Edit: Ah, due to synapse currently not building on develop.

@anoadragon453 anoadragon453 force-pushed the anoa/dendrite_dockerfile branch from 9c9fffe to 0b3235f Jan 25, 2019

@anoadragon453 anoadragon453 force-pushed the anoa/dendrite_dockerfile branch from f47c9d1 to 60e1b80 Jan 25, 2019

@anoadragon453 anoadragon453 requested a review from matrix-org/synapse-core Jan 25, 2019

@anoadragon453 anoadragon453 removed the request for review from matrix-org/synapse-core Jan 28, 2019

@anoadragon453 anoadragon453 changed the title Add sytest dockerfile for dendrite [WIP] Add sytest dockerfile for dendrite Jan 28, 2019

@anoadragon453

This comment has been minimized.

Copy link
Member Author

commented Jan 28, 2019

Currently blocked on #452 merged

@anoadragon453 anoadragon453 changed the title [WIP] Add sytest dockerfile for dendrite Add sytest dockerfile for dendrite Mar 27, 2019

@anoadragon453 anoadragon453 requested a review from matrix-org/synapse-core Mar 27, 2019

@anoadragon453 anoadragon453 changed the title Add sytest dockerfile for dendrite Add dockerfile for dendrite Mar 27, 2019

@erikjohnston
Copy link
Member

left a comment

It'd be good to move a lot of the setup code for the database and sytest inside the docker image (like we do for synapse), to avoid having to do it every time we do a CI run.

(Also, bonus points if you also copy setting the fsync options so that things go faster)

@anoadragon453

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2019

@erikjohnston Is it possible to run commands that require postgres to be running like creating databases in the Dockerfile?

@erikjohnston

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

@erikjohnston Is it possible to run commands that require postgres to be running like creating databases in the Dockerfile?

I believe so, but its probably best to leave that to dendrite when it starts?

@anoadragon453

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2019

Ok, assumed that was part of the database setup code that you mentioned, but if not then that's fine to leave to the actual running container.

Moved some postgres things to the dockerfile

@anoadragon453 anoadragon453 requested a review from erikjohnston Mar 27, 2019

./install-deps.pl

# Initialise the database files and start the database
su -c '/usr/lib/postgresql/9.6/bin/initdb -E "UTF-8" --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8" --username=postgres' postgres

This comment has been minimized.

Copy link
@erikjohnston

erikjohnston Mar 27, 2019

Member

Oh sorry, you can and should run this in the dockerfile, just the create database stuff below can stay. You then also don't need to explicitly call start as it'll have been started automatically

This comment has been minimized.

Copy link
@anoadragon453

anoadragon453 Mar 27, 2019

Author Member

Mm, you say that but computer says no:

+ su -c 'psql -c "CREATE USER dendrite PASSWORD '\''itsasecret'\''" postgres'
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
$

This comment has been minimized.

Copy link
@erikjohnston

erikjohnston Mar 28, 2019

Member

Yeah, its just the initdb that you want to move up (though there is nothing stopping you from starting the database technically)

This comment has been minimized.

Copy link
@anoadragon453

anoadragon453 Mar 28, 2019

Author Member

By move up did you mean move it to the Dockerfile?


# Make sure all Perl deps are installed -- this is done in the docker build so will only install packages added since the last Docker build
dos2unix ./install-deps.pl
./install-deps.pl

This comment has been minimized.

Copy link
@erikjohnston

erikjohnston Mar 27, 2019

Member

Can you please also run this in the dockerfile, that way most dependencies will be pre-installed but new ones will still be picked up. Otherwise it takes like 15mins

Nevermind

@anoadragon453 anoadragon453 requested a review from erikjohnston Apr 2, 2019

@anoadragon453 anoadragon453 merged commit 8fdb332 into develop Apr 4, 2019

4 checks passed

Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Merged PR) Build finished.
Details
Sytest-Branches Build #2456 origin/anoa/dendrite_dockerfile succeeded in 4 min 57 sec
Details
Sytest-Postgres-Branches Build #2634 origin/anoa/dendrite_dockerfile succeeded in 6 min 23 sec
Details

@anoadragon453 anoadragon453 deleted the anoa/dendrite_dockerfile branch Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.