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

docker: add support for pulse.test (bug 1940614) #66

Open
wants to merge 2 commits into
base: zeid/bug-1885346-new-lando
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ use it as a normal local development repository.
`~/test-repo-cinnabar/`. The forked version of Arcanist is also
provided and aliased as the `cinnabarc`.

## Using the git_hg_sync service

While a Pulse exchange is created by default, nothing listens to it. It
is possible to start a `git_hg_sync` container to test the SCM sync
logic. To do so there should first be a local clone of
https://github.com/mozilla-conduit/git-hg-sync at `../git-hg-sync`. The
Compose stack can then be started with the additional
`docker-compose.git_hg_sync.yml` override.

For example

```
docker-compose -f docker-compose.yml [...] -f docker-compose.git_hg_sync.yml up -d
```

The logs of the system can be perused with

```
docker-compose -f docker-compose.yml [...] -f docker-compose.git_hg_sync.yml logs -f git_hg_sync
```

## Accessing the websites provided by the suite

### Firefox configuration
Expand Down Expand Up @@ -250,7 +271,13 @@ in with
A local Git server is also available at http://git.test. The `conduit` user can
log in with the credentials above. For administrative tasks, the account details are as follows:

`user: git-admin`, `password:password123456789!`
`user:git-admin`, `password:password123456789!`

A local RabbitMQ server is running at pulse.test:5672. The administrative
interface can be found at http://pulse.test:15672. The credentials are
this service are

`user:guest`, `password:guest`

## Updating the preloaded Phabricator database

Expand Down
19 changes: 19 additions & 0 deletions docker-compose.git_hg_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
git_hg_sync:
build:
context: ../git-hg-sync
image: git_hg_sync
command: --config /app/config-suite.toml
volumes:
- ../git-hg-sync:/app
- ./docker/git-hg-sync/config-suite.toml:/app/config-suite.toml
environment:
PULSE_HOST: pulse.test
PULSE_PORT: 5672
PULSE_QUEUE: queue/suite/git-hg-sync
PULSE_EXCHANGE: exchange/suite/git-hg-sync
PULSE_ROUTING_KEY: git-hg-sync
PULSE_SSL: "" # False
depends_on:
pulse.test:
condition: service_healthy
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,21 @@ services:
- bmo.pushd
- autoland.hg.test

###########################
# Pulse
###########################

pulse.test:
image: rabbitmq:3-management-alpine
volumes:
- ./docker/rabbitmq/90-definitions-import.conf:/etc/rabbitmq/conf.d/90-definitions-import.conf
- ./docker/rabbitmq/definitions.json:/etc/rabbitmq/definitions.json
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 5s
timeout: 2s
retries: 1

###########################
# Proxy containers
###########################
Expand Down
3 changes: 3 additions & 0 deletions docker/rabbitmq/90-definitions-import.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Does not require management plugin to be enabled.
definitions.import_backend = local_filesystem
definitions.local.path = /etc/rabbitmq/definitions.json
58 changes: 58 additions & 0 deletions docker/rabbitmq/definitions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"bindings": [
{
"arguments": {},
"destination": "queue/suite/git-hg-sync",
"destination_type": "queue",
"routing_key": "git-hg-sync",
"source": "exchange/suite/git-hg-sync",
"vhost": "/"
}
],
"exchanges": [
{
"arguments": {},
"auto_delete": false,
"durable": true,
"internal": false,
"name": "exchange/suite/git-hg-sync",
"type": "direct",
"vhost": "/"
}
],
"permissions": [
{
"configure": ".*",
"read": ".*",
"user": "guest",
"vhost": "/",
"write": ".*"
}
],
"queues": [
{
"arguments": {},
"auto_delete": false,
"durable": true,
"name": "queue/suite/git-hg-sync",
"vhost": "/"
}
],
"users": [
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"limits": {},
"name": "guest",
"password_hash": "ywxQjVk0n/qwUfbLIf7L2tJIXrNLfM1bd1GoMeJSzZiRMWSd",
"tags": ["administrator"]
}
],
"vhosts": [
{
"description": "Default virtual host",
"metadata": { "description": "Default virtual host", "tags": [] },
"name": "/",
"tags": []
}
]
}