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

lando: add lando functionality (bug 1885346) #52

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ system, collectively known as "Conduit". This includes

* BMO, Mozilla's Bugzilla fork
* Phabricator, including extensions and patches
* Lando, both API and UI
* Lando
* Transplant, the service that lands commits
* A Mercurial server
* A container ("local-dev") with various command-line tools including MozPhab
Expand All @@ -27,7 +27,7 @@ substitute for self-contained tests in individual repositories.
1. You need to have [docker](https://docs.docker.com/install/) and
[docker-compose](https://docs.docker.com/compose/install/) installed.
1. For Lando, an Auth0 developer account. See the
[lando-ui README.md](https://github.com/mozilla-conduit/lando-ui/blob/master/README.md)
[lando README.md](https://github.com/mozilla-conduit/lando/blob/master/README.md)
for instructions on how to set that up.

### Steps
Expand All @@ -39,6 +39,8 @@ substitute for self-contained tests in individual repositories.
required for Lando and Transplant. If in doubt, please refer to the
relevant projects. Here is a sample file:

XXX This example is outdated

```
version: '3.4'
services:
Expand Down Expand Up @@ -75,20 +77,12 @@ services:

* Run `docker-compose build`

### First run of Lando

If you are running Lando, you will need to first initialize the database:

```shell
docker-compose exec lando-api lando-cli db upgrade
```

## Using the local-dev service

The "local-dev" container includes command-line tools used to interact
with Conduit services.

To set up the container run `docker-compose run local-dev`.
To set up the container run `docker-compose run --rm local-dev`.
You will be placed inside of a repository cloned from http://hg.test. You can
use it as a normal local development repository.

Expand Down Expand Up @@ -119,10 +113,11 @@ proxy, or run a preconfigured Firefox.

### Websites provided by the suite

* Phabricator - http://phabricator.test
* Lando - http://lando-ui.test
* Lando API - http://lando-api.test/ui via Swagger UI.
* Bugzilla - http://bmo.test
* Phabricator - http://phabricator.test
* Lando - http://lando.test
* (Legacy) Lando - http://lando-ui.test
* (Legacy) Lando API - http://lando-api.test/ui via Swagger UI.
* Mercurial - http://hg.test

## Running apps from local clone
Expand All @@ -142,11 +137,10 @@ repositories you wish to use locally to the `conduit` directory.
```shell
git clone [email protected]:mozilla-conduit/arcanist.git
git clone [email protected]:mozilla-bteam/bmo.git
git clone [email protected]:mozilla-conduit/lando-api.git
git clone [email protected]:mozilla-conduit/lando-ui.git
git clone [email protected]:mozilla-conduit/lando.git
git clone [email protected]:mozilla-conduit/phabricator.git
git clone [email protected]:mozilla-conduit/phabricator-emails.git
git clone [email protected]:mozilla-conduit/review.git
git clone [email protected]:mozilla-conduit/review.git # moz-phab
```

If you've installed all of the above projects, your directory structure
Expand All @@ -158,8 +152,7 @@ conduit
├── arcanist/
├── bmo/
├── suite/
├── lando-api/
├── lando-ui/
├── lando/
├── phabricator/
├── phabricator-emails/
└── review/
Expand Down Expand Up @@ -199,13 +192,12 @@ docker-compose \
up --build -d
```

And for example to work on lando-ui and lando-api,
And for example to work on lando,

```shell
docker-compose \
-f docker-compose.yml \
-f docker-compose.lando-api.yml \
-f docker-compose.lando-ui.yml \
-f docker-compose.lando.yml \
-f docker-compose.override.yml \
up --build -d
```
Expand All @@ -220,11 +212,10 @@ of the ARC wrapper "review" , load the `docker-compose.review.yml`.

If you don't want to spin up all configured containers, you can
specify the ones you'd like to work on. The command below runs
`phabricator.test`, `phabricator`, `phabdb`, `lando-api.test`,
`lando-api` and `lando-api.db` to allow the verification of the
`phabricator.test`, `phabricator`, `phab.db`, `lando.test`,
integration between Phabricator and Lando API:

`docker-compose up phabricator.test lando-api.test`
`docker-compose up phabricator.test lando.test`

## Preconfigured users:

Expand Down Expand Up @@ -295,24 +286,23 @@ Start the suite:

```shell
docker-compose up -d
docker-compose exec lando-api lando-cli db upgrade
```

Create a diff:

```shell
$ docker-compose run local-dev
# ./clone-repositories.sh
$ docker-compose run --rm local-dev
# cd repos
# cd test-repo
# echo test >> README
# hg commit -m "test info added"
# moz-phab install-certificate
# moz-phab submit -b 1
```

Log in to http://lando-ui.test.
Log in to http://lando.test.

Navigate to http://lando-ui.test/revisions/D2.
Navigate to http://lando.test/revisions/D2.

Confirm the warning and click on the `Land` button.

Expand Down
1 change: 0 additions & 1 deletion docker-compose.autolandhg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

version: '3.4'
services:
autoland.hg-init:
build:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.bmo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

version: '3.4'

services:
bmo.test:
build:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.cinnabarc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

version: '3.4'
services:
local-dev:
volumes:
Expand Down
70 changes: 0 additions & 70 deletions docker-compose.lando-api.yml

This file was deleted.

21 changes: 0 additions & 21 deletions docker-compose.lando-ui.yml

This file was deleted.

68 changes: 68 additions & 0 deletions docker-compose.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

services:
lando:
build:
context: ../lando/.
image: suite_lando
stdin_open: true
tty: true
command: bash -c "
lando generate_version_file &&
lando collectstatic --clear --no-input &&
lando migrate &&
lando setup_dev &&
lando runserver 0.0.0.0:80"
user: "${UID}:${GID}" # needed for file generation in the mounted volumes
volumes:
- ../lando:/code
- ../lando/staticfiles:/staticfiles
- ../lando-prorotype/media:/mediafiles

lando.hg-landing-worker:
image: suite_lando
user: "${UID}:${GID}" # needed for file generation in the mounted volumes
volumes:
- ../lando:/code
- ../lando/staticfiles:/staticfiles
- ../lando-prorotype/media:/mediafiles

lando.test:
build: ../lando/nginx
ports:
- 443:443
depends_on:
- lando
volumes:
- ../lando/staticfiles:/staticfiles
- ../lando/media:/mediafiles

lando.db:
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 1s
timeout: 1s
retries: 10

lando.redis:
image: redis:7.2
healthcheck:
test: ["CMD", "redis-cli", "ping"]

lando.celery:
image: suite_lando
command: lando start_celery_worker
depends_on:
lando.redis:
condition: service_healthy

volumes:
media:
1 change: 0 additions & 1 deletion docker-compose.phabricator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

version: '3.4'
services:
phabricator:
build:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

version: '3.4'
services:
local-dev:
command: bash -c "cd review && pip3 install -e . && cd ~ && bash"
Expand Down
Loading