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

Dev: provide DDEV project config for new developers #21883

Closed
rr-it opened this issue Feb 5, 2024 · 3 comments · May be fixed by #22245
Closed

Dev: provide DDEV project config for new developers #21883

rr-it opened this issue Feb 5, 2024 · 3 comments · May be fixed by #22245
Labels
answered For when a question was asked and we referred to forum or answered it. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Easier debugging For issues that make troubleshooting issues for developers easier. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@rr-it
Copy link
Contributor

rr-it commented Feb 5, 2024

Summary

I'd like to give new developers an easy start to develop on Matomo.

With an already running DDEV environment (depends on Docker) it should be an effortless exercise:

# Checkout matomo repository
#git clone https://github.com/matomo-org/matomo matomo
git clone -b dev/ddev-project-env --single-branch https://github.com/rr-it/matomo.git matomo-test

#cd matomo
cd matomo-test
git submodule update --init

# Optional: Change DDEV project name (default: 'matomo')
ddev config --project-name matomo-test

# Start already configured DDEV project
ddev start

# Show basic information about the DDEV project
ddev describe
┌─────────────────────────────────────────────────────────────────────────────┐
│ Project: matomo ~/SOME-DIR/matomo https://matomo.ddev.site                  │
│ Docker platform: linux-docker                                               │
│ Router: traefik                                                             │
├──────────┬──────┬──────────────────────────────────────┬────────────────────┤
│ SERVICE  │ STAT │ URL/PORT                             │ INFO               │
├──────────┼──────┼──────────────────────────────────────┼────────────────────┤
│ web      │ OK   │ https://matomo.ddev.site             │ php PHP7.2         │
│          │      │ InDocker: web:443,80,8025            │ nginx-fpm          │
│          │      │ Host: 127.0.0.1:49166,49167          │ docroot:''         │
│          │      │                                      │ Perf mode: none    │
│          │      │                                      │ NodeJS:16          │
├──────────┼──────┼──────────────────────────────────────┼────────────────────┤
│ db       │ OK   │ InDocker: db:3306                    │ mysql:5.7          │
│          │      │ Host: 127.0.0.1:49168                │ User/Pass: 'db/db' │
│          │      │                                      │ or 'root/root'     │
├──────────┼──────┼──────────────────────────────────────┴────────────────────┤
│ Mailpit  │      │ Mailpit: https://matomo.ddev.site:8026                    │
│          │      │ `ddev launch -m`                                          │
├──────────┼──────┼───────────────────────────────────────────────────────────┤
│ All URLs │      │ https://matomo.ddev.site, https://127.0.0.1:49166,        │
│          │      │ http://matomo.ddev.site,  http://127.0.0.1:49167          │
└──────────┴──────┴───────────────────────────────────────────────────────────┘

# Init Matomo:
ddev matomo:init:base

# Open Matomo in browser:
# https://matomo.ddev.site/
ddev launch

# Do the first install before going on!
#
# Database config:
# + server:   db
# + username: db
# + password: db
# + db-name:  db

# Important: Finish first install before going on.
# Init Matomo including test environment
ddev matomo:init:all

# Run PHP Tests
ddev exec ./console tests:run tests/PHPUnit/System/BlobReportLimitingTest.php

# Run UI Tests
ddev exec ./console tests:run-ui --persist-fixture-data --keep-symlinks Comparison

# Open url to reproduce in browser: 
# http://matomo.ddev.site/tests/PHPUnit/proxy/?module=CoreHome&action=index&idSite=1&period=range&date=2012-01-12,2012-01-17#?idSite=1&period=range&date=2012-01-12,2012-01-17&comparePeriods[]=range&compareDates[]=2012-01-06,2012-01-11&compareSegments[]=continentCode%3D%3Deur&category=General_Visitors&subcategory=General_Overview

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
@rr-it rr-it added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. To Triage An issue awaiting triage by a Matomo core team member labels Feb 5, 2024
@rr-it rr-it mentioned this issue Feb 5, 2024
11 tasks
@michalkleiner michalkleiner added c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Easier debugging For issues that make troubleshooting issues for developers easier. and removed To Triage An issue awaiting triage by a Matomo core team member labels Feb 6, 2024
@michalkleiner
Copy link
Contributor

michalkleiner commented Feb 6, 2024

Hi @rr-it and thanks for opening the draft PR. I started this response at the PR but then thought it's best to have the discussion at the issue itself.

We have an internal initiative looking into providing a virtualised dev environment for Matomo and ddev is one of the options considered. I use ddev for Matomo locally already but we also have other options like (but not only) https://containers.dev/ and we haven't yet evaluated all the aspects of each tool in full to make a decision which way to go. It's certainly handy to have a community contribution that can provide inspiration and possibly lead the way on some aspects of the work. I, for example, didn't know there were the host commands, those are quite handy.

It's good you opened the issue for the pull request as well. I'm sure you haven't spent tens of hours of time on this yet but could I perhaps suggest to seek the teams' opinion/guidance adding the RFC label on the issue or just simply by opening and asking in the issue (we usually get to see it in a day) for all of us to better align on the approach and make the best use of your time and your contribution?

Before we can get to anything merged in the area of providing a unified dev environment within Matomo codebase, we have to be quite confident it will work for most.
We also need to consider the level of support we can (or can't) provide once/if it becomes part of the codebase. It's also possible it would be a separate tool/repository that we will recommend from the documentation, or some other mix&match of all above.

People in our team have experience with ddev, have run it on several projects, and it could as well be the best available solution at the moment. I'll see if we can share some of the aspects we were looking into so you could provide your view on those as well.

Could you share your answers to these questions in the meantime?

  • What OS are you using?
  • What docker provider are you using (Rancher, Orbstack, Colima, Lima, Docker Desktop, ...)?
  • Do you use Mutagen if on MacOS? Any issues with it?
  • How many projects using ddev do you run simultaneously?
  • Have you tried Lando or Laravel Valet and can you compare?

Thanks again for your time and the contribution!

@rr-it
Copy link
Contributor Author

rr-it commented Feb 6, 2024

@michalkleiner This PR is more or less the documentation of my already running DDEV setup. So next time I will get Matomo running quickly by myself.

Software stack:

  • OS: Debian 11 "bullseye" incl. bullseye-backports
  • Kernel: 6.1.0 (Debian package)
  • Docker: docker.io 20.10.5+dfsg1-1+deb11u2
    (Debian package built against Debian library-packages – see explanation)
  • DDEV: v1.22.6 (installed via Homebrew)

On running multiple DDEV projects simultaneously:

I have at max 2 or 3 projects really running simultaneously in DDEV.
The other projects with their docker containers are just not powered on.

Usually I work on TYPO3 projects, which not only include the 'web' and 'db' container, but also some more containers like 'Solr'.

Performance / hardware:

  • CPU: 32 threads (2x 8-core-CPU with hyperthreading)
  • RAM: 128 GB
  • SSD: SATA WD blue (desktop modell)

The hardware is handling the load totally fine. I can't say what happens on more constrained hardware.


On getting Matomo initialized by CLI

I miss some CLI commands to get Matomo running without any interaction:

  • Initial install is via browser only?
    • set db-settings
    • initialize db
    • set first admin-user
    • add first website to track
  • Configure sections [database_tests] and [tests] in config/config.ini.php
  • Configure UI tests in tests/UI/config.js

@michalkleiner
Copy link
Contributor

Thanks for the additional information, @rr-it, appreciate it!
For now we've closed the issue since we are working on a similar initiative, as mentioned above.
We will keep the draft PR for a bit to revisit/get some insights from it if needed. Once again thanks a lot for taking the time and for sharing this!

@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Easier debugging For issues that make troubleshooting issues for developers easier. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants