Граф коммитов

153 Коммитов

Автор SHA1 Сообщение Дата
Martin Raymond Kraft
58dce5930e [MM-31094] Replication Lag (#16888)
* MM-31094: Adds tooling to develop and test using a MySQL instance with replication lag. Adds some lazy lookups to fallback to master if results are not found.

* MM-31094: Removes mysql-read-replica from default docker services.

* MM-31094: Switches (store..SessionStore).Get and (store.TeamStore).GetMember to using context.Context.

* MM-31094: Updates (store.UsersStore).Get to use context.

* MM-31094: Updates (store.PostStore).Get to use context.

* MM-31094: Removes feature flag and config setting.

* MM-31094: Rolls back some master reads.

* MM-31094: Rolls a non-cache read.

* MM-31094: Removes feature flag from the store.

* MM-31094: Removes unused constant and struct field.

* MM-31094: Removes some old feature flag references.

* MM-31094: Fixes some tests.

* MM-31094: App layers fix.

* MM-31094: Fixes mocks.

* MM-31094: Don't reparse flag.

* MM-31094: No reparse.

* MM-31094: Removed unused FeatureFlags field.

* MM-31094: Removes unnecessary feature flags variable declarations.

* MM-31094: Fixes copy-paste error.

* MM-31094: Fixes logical error.

* MM-30194: Removes test method from store.

* Revert "MM-30194: Removes test method from store."

This reverts commit d5a6e8529bd5f4d993824c828e239d009b05e567.

* MM-31094: Conforming to make's strange syntax.

* MM-31094: Configures helper for read replica with option.

* MM-31094: Adds some missing ctx's.

* MM-31094: WIP

* MM-31094: Updates test names.

* MM-31094: WIP

* MM-31094: Removes unnecessary master reads.

* MM-31094: ID case changes out of scope.

* MM-31094: Removes unused context.

* MM-31094: Switches to a helper. Removes some var naming changes. Fixes a merge error.

* MM-31094: Removes SQLITE db driver ref.

* MM-31094: Layer generate fix.

* MM-31094: Removes unnecessary changes.

* MM-31094: Moves test method.

* MM-31094: Re-add previous fix.

* MM-31094: Removes make command for dev.

* MM-31094: Fix for login.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-12 12:37:30 -05:00
Elisabeth Kulzer
fa2ecad0a9 Remove Jenkinsfile (#17066) 2021-03-04 16:38:23 +01:00
Jyoti Patel
87f553283a [GH-15906][MM-22844] Redesign welcome and verify email. (#16824)
Automatic Merge
2021-02-26 05:22:26 +01:00
Martin Raymond Kraft
22308ea21c Updates the release version of the osixia/openldap Docker image. (#16893) 2021-02-17 16:10:27 -05:00
Mattermost Build
46b4987873 Bump version (#16952)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-02-17 10:50:21 +01:00
Mattermost Build
c14194d78b Bump version (#16813)
Automatic Merge
2021-01-28 13:15:17 +01:00
Jesse Hallam
f8caa6c841 Job metrics & dynamic Grafana annotations (#16650)
* docker: prometheus and grafana for development

Add prometheus and grafana docker configuration when developing with access to the enterprise repository. This simplifies the setup for developers adding new metrics or even examining events from their development server. The services are disabled by default when no enterprise source is detected.

Grafana is provisioned automatically with the Prometheus datasource, as well as the canonical dashboards used with Mattermost. Furthermore, no authentication is required to access Grafana to simplify access from a development environment. The default home dashboard is customized to automatically show links to the provisioned dashboards. Dashboards can be saved, and login remains available via the default `admin/admin` credentials (which initiates a password reset), but no dashboard or system configuration is (currently) persisted if the container is destroyed.

Linux requires slightly special handling (well, really it's Docker for MacOS/Windows), in that `host.docker.internal` is the canonical way to resolve the host on MacOS/Windows, but on Linux it's usually sufficient to just use `localhost`. Until https://github.com/docker/for-linux/issues/264 is resolved, this PR includes code to customize the Prometheus configuration to point at the required address for the running platform.

* metrics: track active jobs by type

* metrics: active jobs chart

* metrics: server start and job annotations

* Update build/docker-compose.common.yml

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* prometheus: resolve docker host via 172.17.0.1 instead

* skip enabling prometheus and grafana by default

* handle JOB_STATUS_ERROR and JOB_STATUS_CANCELED end states

* handle nil srv.metrics

* lookup job to determine type for metrics

* mocked unit tests for jobs

* goimports lint fixes

* missing license

* add instance to server start tag

* filter annotations by selected instance

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-20 15:43:02 -04:00
Jesse Hallam
d5659adbd7 docker: prometheus and grafana for development (#16649) 2021-01-19 22:28:22 -04:00
John Tzikas
0391fe7de9 Add make command for running the app in an HA topology (#16702)
* Add make command for running the app in an HA topology

* Tidy up conf files, remove unnecessary commands and add restart-haserver command

* Use the right flag for checking enterprise folder presence before ha setup
2021-01-18 19:38:44 +02:00
Agniva De Sarker
caeda90b24 Bump up Go docker image to 1.15.5 (#16744)
```release-notes
NONE
```
2021-01-16 09:35:38 +05:30
Scott Bishel
a40533e577 MM-30362: Cypress/E2E: LDAP-SAML Sync (#16616)
* allow username changes for testing

* remove bad cert, add new one

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-13 15:25:27 -07:00
Martin Kraft
405a305753 MM-31744: Removes privacy policy text from repo, points to website. (#16645) 2021-01-07 09:06:10 -05:00
Elisabeth Kulzer
aa7aefbac3 Bump golang image (#16314)
* Fix images

* Add golangci-lint also

* Bump golang image

* Replace tag

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-04 15:21:01 +01:00
Mattermost Build
83afd756b6 Bump version (#16592)
* Bump version

* Uncomment shouldPerformUpgrade

Co-authored-by: Mmbot <mmbot@mattermost>
Co-authored-by: Elisabeth Kulzer <elikul@elikul.de>
2020-12-23 16:33:07 +01:00
Agniva De Sarker
eb7c4580f8 MM-28549: Bump up postgres version (#16564)
https://mattermost.atlassian.net/browse/MM-28549

```release-notes
Mattermost does not support Postgres 9.4 anymore. The minimum
required version for Postgres will be 10.
```
2020-12-16 09:26:49 +00:00
Jason Paul Deland
b363ff3fad Update Jenkinsfile.branch
Revert changes to the branch used for saml libs
2020-12-10 19:48:34 -05:00
Jason Paul Deland
599e8f67e6 Update Jenkinsfile.branch
Update the saml libs branch to master also
2020-12-10 13:00:25 -05:00
Amy Blais
e8371d915f Update Dockerfile (#16488)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-07 12:44:41 +01:00
Jason Paul Deland
f733ee9332 Update Jenkinsfile.branch
Adding SAML lib changes
2020-12-02 14:23:43 -05:00
Mario de Frutos Dieguez
58d362e0c8 Include cloud defaults in the EE release package (#16277)
That defaults file would be used in the cloud installations to set the
initial values for them
2020-11-16 16:52:26 +01:00
Agniva De Sarker
c82c37a36e MM-28067: Optimize app server startup in tests (#16263)
* MM-28067: Optimize app server startup in tests

For every test, we would wipe out the database and then start
the server again. This would run through all the migrations
and create new rows in Systems and Roles table every time.
As a result, this was consuming a lot of setup time for every test.

We optimize this by preloading the DB with dummy data in the roles
and systems table so that the server code just skips over those migrations.
This is completely forward compatible and adding new migrations does not
need to generate the sql files again. Only in case of schema changes to the
roles or systems table, this would need to be done.

It is unlikely the Systems table schema will get changed. The Roles table
might change in future but it's a comparatively rare event. Given the reduction
in CI runtime we are seeing, it's a worthy optimization.

We also apply some more optimizations:
- Coalesce multiple UpdateConfig calls into a single one. Each UpdateConfig call
has to do a json marshal which would take precious CPU cycles. It's much more
efficient to do everything in a single call.
- Remove unnecessary debug.FreeOSMemory in reload config. This was an artifact
from old days and is no longer required.

Numbers:
Results show a full **2 minutes** shaved off the test runtime. Earlier, tests
would take around 16 minutes. Now they take 14 minutes.

```release-note
NONE
```

* fix app package
2020-11-16 13:55:32 +01:00
cpanato
0f4c6bc074 fix git commit hash to use in the docker image 2020-11-11 19:27:45 +01:00
cpanato
3782b3e21b fix docker push 2020-11-11 18:25:53 +01:00
cpanato
37e8fe8e33 fix build branch pipeline 2020-11-11 17:42:07 +01:00
Carlos Tadeu Panato Junior
2c08ff1299 build: push git commit hash as tags as well (#16261) 2020-11-11 17:11:48 +01:00
Amy Blais
28983fa88d Update Dockerfile (#16118)
Automatic Merge
2020-10-29 08:54:01 -04:00
Mario de Frutos Dieguez
bb095c2a1a mmctl is not being included in the package (#16105)
It's was including it in the bin folder but when we package we need to include it in the dist/bin so right now the `download_mmctl` script accepts a second parameter to define the path where the binary is going to be stored
2020-10-28 13:59:49 +01:00
Elisabeth Kulzer
8c63eb7232 DOPS-243: Add manifest.txt (#15959)
* DOPS-243: Add manifest.txt

* Update build/release.mk

* Change path

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-23 09:41:33 +02:00
Jason Paul Deland
e280aa1c63 Update to get latest release from S3 (#15952)
* Update to get latest release from S3

* Update mmctl to download to use S3

* Download MMCTL from S3

* Update download_mmctl_release.sh

* Update Makefile

* Update release.mk

* Update the script called, remove call to sub shell and clean up indentation

* Add quotes around THIS_BRANCH var

* Update script to support overriding the OS for packaging

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-16 20:27:50 -04:00
Elisabeth Kulzer
b9f8d24cbc Move environment variables to env-file (#15820) 2020-10-08 11:24:16 +02:00
Elisabeth Kulzer
14fe307436 Add healthcheck to docker-compose databases to easier debug (#15735)
* Waiting for postgres to startup before tests

* Add healthcheck

* Test postgres default

* Prefer pgisready command

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-02 12:32:23 +02:00
Carlos Tadeu Panato Junior
c2554dc30e bump the package placeholder to use the latest mm package release (#15688) 2020-10-01 13:50:26 +02:00
Ashish Bhate
ee76ad435b [MM-28303]: check if mmctl exists before checking on Github and reduce requests to Github (#15387)
Summary:
Every make call would ping Github to find out the mmctl version to download. Each check made 4 requests to Github. So every make execution resulted in 4 requests to Github. This leads to frequent rate-limit errors from Github.
In this PR we check for the mmctl version only if mmctl doesn't already exist. We also print a more helpful error message.
Reduce the number the number of requests to Github from 4 to 2.

Ticket Link:
https://mattermost.atlassian.net/browse/MM-28303
2020-09-24 14:54:57 +05:30
Jason Paul Deland
1be5512655 Remove check on MMCTL Value 2020-09-02 16:59:08 -04:00
Carlos Tadeu Panato Junior
3fc9ed9871 image: bump default MM package to use release 5.26.0 (#15276) 2020-08-19 14:23:47 +02:00
Agniva De Sarker
e1ca3e348f MM-27512: Use an authenticated user to bump up request rate limit (#15251)
* MM-27512: Use an authenticated user to bump up request rate limit

An unauthenticated user can only make 60 requests per hour which means 1
request every minute. This can lead to frequent rate limit errors while
getting the latest release.

We change that to use an authenticated user which is already available
in the CI. This moves us to make 5000 requests per hour.

We also add additional logging in the Makefile targets in case
the command fails again so that it's clear what has happened, and not return
cryptic 404 errors again.

Ideally, we should be able to inspect the output of the curl command, but since
the output value of the entire bash script is fed into the variable, it is a bit
difficult to print debug output.

If this still gives error, then we need to either use a cached artifact somehow
or add additional logging and add a retry logic on top of it.

* fix mistake
2020-08-18 19:42:12 +05:30
Agniva De Sarker
ac26555cdb MM-27735: Do not build test and other tools in CI (#15238)
Our codebase uses main_test.go files to control tests at a package level.
However, the problem with that is when we use ./... to build the codebase,
those binaries also get built.

This is unnecessary and creates further delays in the pipeline. All we need to build
are only mattermost and platform binaries in CI. The rest are dependant on the developer.

In my dev environment, this reduces the build times from 13 seconds to 4 seconds.

https://mattermost.atlassian.net/browse/MM-27735
2020-08-13 19:40:15 +05:30
Elisabeth Kulzer
94ee1fa5c6 IS-255: Test and remove code for creating enterprise docker image. (#14395)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-08-03 11:23:45 +02:00
Agniva De Sarker
9bfc5de44c MM-26584: Bump up Go patch version (#15156)
* MM-26584: Bump up Go patch version

This contains a patch fix for https://github.com/golang/go/issues/38023
which have been encountered in our load tests and some users.

I have verified on such a stuck instance and the thread dump seem to match
with what is seen on the issue. All threads stuck on runtime.futex, except one,
which is at runtime.osyield.

And of all the times load tests were run which _did not_ show this issue,
it was run with a version greater than 1.14.1, which further points to the
theory that this bug is the culprit.

* Replace docker image versions.

* Update build/README.md

Co-authored-by: Elisabeth Kulzer <elikul@elikul.de>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-08-01 00:08:04 +05:30
Carlos Tadeu Panato Junior
ed3c93716d docker: update base package to use MM release 5.25.2 (#15153)
Automatic Merge
2020-07-31 15:40:16 +02:00
Jesús Espino
e980dd7bd3 Configurable dev environment (#14869)
* Configurable dev environment

* Add a bit of documentation

* fixing gofmt

* A bit more doc

* Using  variable

* Adding license header

* Moving LDAP_DATA variable to the default-config.mk file

* Adding another docker-compose for the makefile to not brake anybody workflow

* Moving dejavu to the config

* Fixing docker-compose.makefile.yaml for dejavu

* Adding keycloak support to the dev environment

* Address PR review comments

* Removing minio from default docker images

* Changing the default version of mysql to the oldest supported (5.6)

* Change the restart option to no for the dev environment

* Fixing restart option

* Reverting unneded changes

* Restoring 5.7 to check if test passes

* Going back to 5.6 mysql image

* Fixing tests on mysql 5.6

* Skipping flaky test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-07-13 22:29:39 +02:00
Carlos Tadeu Panato Junior
10af90fa27 Update Dockerfile (#14946)
* update alpine base image to 3.12

* update MM package to use 5.24.2 as default
2020-06-30 14:45:17 +02:00
Elisabeth Kulzer
7d1aad9822 Revert "Docker compose network (#14771)" (#14782)
This reverts commit 91f1c47ba3.
master is broken because of this. Skip tests.
2020-06-09 09:56:47 +02:00
Elisabeth Kulzer
91f1c47ba3 Docker compose network (#14771)
* Updating to use a different network cidr for the mm-test network

* Update docker-compose.yaml

Remove gateway as its not needed and caused problems before

Co-authored-by: Jason Deland <jaydeland@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jason Paul Deland <9366595+jaydeland@users.noreply.github.com>
2020-06-09 09:00:09 +02:00
Carlos Tadeu Panato Junior
c2f171af07 dockerfile: bump base MM package to 5.23.1 (#14757)
Automatic Merge
2020-06-05 05:02:16 -07:00
Seweryn Zeman
853e955b62 Change Dockerfile HEALTHCHECK intervals (#14317)
We should not use such a long `HEALTHCHECK` `--interval` as first task check if happening after given time, and before healthcheck returns `0` – **task won't be available** to the Docker networks – meaning that Mattermost won't work until then even if it deployed correctly!

And in Docker envs it happens often – that DB is available all the time, and just MM app is being updated. In this case even if we are healthy since 1s – we need to wait 5min until it goes online.
2020-05-27 17:19:43 +02:00
Jason Blais
235c53189e Add ?src=docker query parameter to identify download source (#14577)
Automatic Merge
2020-05-25 04:29:18 -07:00
Agniva De Sarker
4fe52d677c MM-24652: Bump golangci to 1.25.1 (#14409)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-12 10:36:58 +05:30
Carlos Tadeu Panato Junior
4c16924832 bump base package for MM in dockerfile (#14468) 2020-05-05 18:43:12 +02:00
Mario de Frutos Dieguez
9783294e97 Include dejavu in docker compose (#14329)
* Include dejavu in docker compose
2020-04-21 20:48:04 +02:00