Skip to content

Fix the order of instructions for initialization #126

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

Open
wants to merge 4 commits into
base: master
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
36 changes: 7 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ This will prompt you to confirm removing old indices and setting up mappings on
the Elasticsearch service (say `YES`). It will then proceed to rsync a partial
CPAN in `/CPAN` for its metadata to be imported.

Once the above is done, you should be able to see your local partial CPAN data
in e.g. [http://localhost:5001/recent](http://localhost:5001/recent) and
elsewhere.

Alternatively, if you just want to hack on the web frontend, you can run this
instead of all the above:
After the initialization above completes, the next step is to start the web
frontend with the following command:

docker compose up web-server

Once that is done, you should be able to see your local partial CPAN data
in e.g. [http://localhost:5001/recent](http://localhost:5001/recent) and
elsewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been a while since I set up new containers. After docker compose up web-server are you getting the data from your partial index or is it actually routing your requests to the live API? I suspect it's the latter and if that's the case, that's an error in our documentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think you're right: I'm seeing full recent history and I'm able to browse the "Crop" release which I don't think was imported. How do I make the web service connect to the local API?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we are recommending this way: https://github.com/metacpan/metacpan-docker?tab=readme-ov-file#binmetacpan-localapi

It might be worth looking under the hood to see if this is still works and is the best idea. I would say if it does work, maybe we can just move on to the next thing rather than tweaking too much.

From here, you can proceed and hack on the MetaCPAN code at `src/metacpan-api`
and/or `src/metacpan-web` directories, and saving edits will reload the
corresponding apps automatically!
Expand Down Expand Up @@ -185,28 +185,6 @@ To access the `psql` command line client in the PostgreSQL container:
Each container is responsible for a different service. Some of these services
are available in the developer environment via ports on the host system.

We are using [traefik][13] to manage the traffic between services. The current
configuration is:

- api: [http://api.metacpan.localhost](http://api.metacpan.localhost)
- web: [http://web.metacpan.localhost](http://web.metacpan.localhost)
- grep: [http://grep.metacpan.localhost](http://grep.metacpan.localhost)

In order to access to the localhost subdomains, you probably have to manually
add these entries in you `/etc/hosts` file.

# add to /etc/hosts
127.0.0.1 api.metacpan.localhost
127.0.0.1 gh.metacpan.localhost
127.0.0.1 grep.metacpan.localhost
127.0.0.1 metacpan.localhost
127.0.0.1 web.metacpan.localhost

You can access the dashboard configuration via:
[http://metacpan.localhost:8080](http://metacpan.localhost:8080)

[0]: https://docs.traefik.io/providers/docker/

#### `web`

The local instance of the web front end is accessible via:
Expand Down Expand Up @@ -240,7 +218,7 @@ The PostgreSQL service by default is only accessible from other containers.

The grep metacpan front end is accessible via:

- [http://grep.metacpan.localhost](http://grep.metacpan.localhost)
- [http://localhost:3000](http://localhost:3000)

Note: this is using a smaller, frozen version of `metacpan-cpan-extracted` via
[metacpan-cpan-extracted-lite](https://github.com/metacpan/metacpan-cpan-extracted-lite).
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ services:
profiles:
- grep
image: metacpan/metacpan-grep-front-end:latest
ports:
- "3000:3000"
build:
context: ./src/metacpan-grep-front-end
volumes:
Expand Down