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

Popular Prag Prog topics Top

New
iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
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
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
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
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
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 Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
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
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New

Latest in PragProg

View all threads ❯