pgmcdonnell

pgmcdonnell

Engineering Elixir Applications: JPperf workaround clarification (page 144)

Thanks for the excellent book @elliefairholm and @Gilacost , really well paced and clearly written.

One small suggestion: I think it would be useful to make clear that both the builder and runner need to have the ENV ERL_FLAGS="+JPperf true" in the Dockerfile for the multi-architecture builds to complete sucessfully.

Most Liked

Gilacost

Gilacost

Author of Engineering Elixir Applications

Thank you for your kind words, @pgmcdonnell! We really appreciate your feedback and are glad you’re enjoying the book.

Regarding the ERL_FLAGS="+JPperf true" flag, it’s only required during the build stage and specifically for multi-architecture builds. It’s not needed in the runner stage. I don’t want to spoil the later chapters, but as you progress, you’ll deploy prebuilt images that we create daily for these platforms:

platforms: linux/arm64,linux/amd64

You can verify that the runner stage does not include this ENV flag by inspecting the image with whaler:

❯ whaler ghcr.io/beamops/kanban
Analyzing ghcr.io/beamops/kanban
Docker Version: 27.4.0
GraphDriver: overlayfs
Environment Variables
|PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|LANG=en_US.UTF-8
|LANGUAGE=en_US:en
|LC_ALL=en_US.UTF-8
|MIX_ENV=prod

Image user
|User is root

Potential secrets:
unable to parse history from json file

This image is used in later chapters, and if you want to test it, here’s what you need to do:

Running the Kanban app locally

1. Start PostgreSQL

If you don’t have a running PostgreSQL instance, you can spin one up with Docker:

❯ docker run -d --name postgres-container   -e POSTGRES_PASSWORD=postgres   -p 5432:5432   postgres:latest

2. Find your local IP

Since Docker networking can sometimes cause issues, you may need your local IP to connect from the Elixir container. On macOS (if using Wi-Fi), you can retrieve it with:

❯ ipconfig getifaddr en0

If you’re on Ethernet, replace en0 with the correct interface.

3. Run the Kanban app

Use the obtained IP to set up the DATABASE_URL when running the container:

❯ docker run   -e "DATABASE_URL=ecto://postgres:postgres@192.168.1.178:5432/postgres"   -e "SECRET_KEY_BASE=oQGFFW50gMjfoKx5Naa2C1Ks9aN2rX41wNB9zm9c8ykc54/X06zvRF0lt9UReNbe"   -p 4000:4000   ghcr.io/beamops/kanban:non-distributed

4. Access the app

Visit http://localhost:4000 in your browser, and you should see the Kanban login page.

By the way, I see you’re in the UK—are you based in London, near Clapham by any chance? Would love to meet up at a pub sometime to chat about this or any other Elixir topics!

Cheers,
Pep

Where Next?

Popular Pragmatic Bookshelf topics Top

jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
New

Latest in Engineering Elixir Applications

Sub Categories: