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

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
kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
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
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
alanq
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
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
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
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
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
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
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
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
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New

Latest in Engineering Elixir Applications

Sub Categories: