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 Pragmatic topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
telemachus
Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks” While running the smoke tests in Chapter 2, I get these...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
EdBorn
Title: Agile Web Development with Rails 7: (page 70) I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
New

Other popular topics Top

DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
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
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Latest in PragProg

View all threads ❯