If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
Notes: Jira ticket
The developer setup still describes configuring dockerhost as an alias for 127.0.0.1, as many of the server scripts and unit tests rely on same. The original idea was likely to allow configuring dockerhost to something hosted elsewhere, but for day-to-day development, this seems to cause more trouble in setup and configuration than simply assuming localhost.
This ticket is to primarily to investigate and remove all traces of dockerhost from the mattermost-server repository, replacing with localhost. All Makefile targets should continue to work, and all unit tests should continue to pass.
Part of completing this goal should be to investigate gutting the *-docker targets in Makefile and relying on docker compose instead. We already have a docker compose configuration file in build/docker-compose.yml that sets up for CI tests, but it configures everything to run on an mm-test network, while these resources must remain accessible at localhost unless we preserve the dockerhost configuration above. Finding a solution that streamlines development whilst preserving the CI environment would be proof that we can eliminate the dockerhost altogether.
Can I try this one?
@vineelya go for it!! :tada:
I 'm trying to set up the dev environment and I get the following issue up on trying to run make run-server
➜ mattermost-server git:(master) make run-server
Starting docker containers
Running mattermost for development
mkdir -p ../mattermost-webapp/dist/files
go run -ldflags "-X github.com/mattermost/mattermost-server/model.BuildNumber=dev -X 'github.com/mattermost/mattermost-server/model.BuildDate=Tue Jan 22 07:16:55 UTC 2019' -X github.com/mattermost/mattermost-server/model.BuildHash=15c98c9e763a33650ae0aeecfe703526d0a2aa08 -X github.com/mattermost/mattermost-server/model.BuildHashEnterprise=none -X github.com/mattermost/mattermost-server/model.BuildEnterpriseReady=false" "./cmd/mattermost/main.go" --disableconfigwatch &
➜ mattermost-server git:(master) {"level":"info","ts":1548141418.725378,"caller":"utils/i18n.go:79","msg":"Loaded system translations for 'en' from '/Users/vineely/go/src/github.com/mattermost/mattermost-server/i18n/en.json'"}
{"level":"info","ts":1548141418.725854,"caller":"app/server_app_adapters.go:60","msg":"Server is initializing..."}
{"level":"debug","ts":1548141418.726004,"caller":"utils/html.go:31","msg":"Parsing server templates at /Users/vineely/go/src/github.com/mattermost/mattermost-server/templates"}
{"level":"info","ts":1548141418.7331588,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141418.7753248,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141428.77999,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141428.7825348,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141438.7834291,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141438.785741,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141448.78913,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141448.7915149,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141458.792196,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141458.794691,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141468.795465,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141468.7976708,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141478.798451,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141478.800732,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141488.803829,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141488.806422,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141498.808578,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141498.810346,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141508.81214,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141508.813898,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141518.815905,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141518.8176398,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141528.817889,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141528.8203142,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141538.825085,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141538.827391,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141548.8284621,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141548.830875,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141558.833448,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141558.836162,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141568.836493,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141568.838301,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141578.839786,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141578.842025,"caller":"sqlstore/supplier.go:223","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
{"level":"info","ts":1548141588.847187,"caller":"sqlstore/supplier.go:211","msg":"Pinging SQL master database"}
{"level":"error","ts":1548141588.849482,"caller":"sqlstore/supplier.go:219","msg":"Failed to ping DB, server will exit err=Error 1045: Access denied for user 'mmuser'@'localhost' (using password: YES)"}
exit status 102
Hey @vineelya,
What OS are you using? Did you follow the setup steps on https://developers.mattermost.com/contribute/server/developer-setup/?
Hey @vineelya,
Do you still need help? Feel free to PM me on the Mattermost Community Server.
I will get back to you.
On Thu, Jan 31, 2019 at 4:10 AM Hanzei notifications@github.com wrote:
Hey @vineelya https://github.com/vineelya,
Do you still need help? Feel free to PM me on the Mattermost Community
Server https://community.mattermost.com.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mattermost/mattermost-server/issues/10121#issuecomment-459321763,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AsruACIYl72767_G8abbrIr3QF3mcVdRks5vIt1IgaJpZM4aJHbR
.
I couldn't set up the dev environment and I still face the issues I mentioned.
Hi @vineelya,
Do you mind asking for help in ~peer-to-peer-help on the Mattermost Community Server. It's easier to solve this kind of problems via chat.
Making this one available for the public again due to inactivity.
Interested in taking this one. :)
Hello!
Replaced all dockerhost references with localhost. All Makefile targets continue to work, and all unit tests continue to pass.
https://github.com/scottleedavis/mattermost-server/tree/MM-7971
In terms of the second goal of this ticket, I need some additional clarification. Is the goal to replace *-docker commands content with docker-compose commands in the Makefile?
@cpanato Would you please take a look at the above question?
@scottleedavis the idea (in think, i did not wrote this ticket) is change the docker run for all the images in the make file and replace to one single command which is the docker-compose.
for example, in the makefile we have this
@if [ $(shell docker ps -a --no-trunc --quiet --filter name=^/mattermost-redis$$ | wc -l) -eq 0 ]; then \
echo starting mattermost-redis; \
docker run --name mattermost-redis -p 6379:6379 -d redis > /dev/null; \
elif [ $(shell docker ps --no-trunc --quiet --filter name=^/mattermost-redis$$ | wc -l) -eq 0 ]; then \
echo restarting mattermost-redis; \
docker start mattermost-redis > /dev/null; \
fi
the idea is delete all and replace to
to start make start-docker
docker-compose --no-ansi run --rm start_dependencies
docker-compose --no-ansi exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest -f /${LDAP_DATA}-data.ldif';
to stop make stop-docker
docker-compose --no-ansi down -v
thank you @cpanato ! I applied your changes to the Makefile and it appears to work! However, startup time for make run seems greatly reduced, and there are lots of 'sleeping' lines in initial output. For this reason I labeled it WIP until it can be improved. If I am doing anything incorrectly I would like to know.
I spoke too soon, not working again. Will keep at it. :)
Had to add port exposure for OSX @cpanato otherwise it works as you showed. :)