Genie Discord forum

I am running my app locally and when I set GENIE_ENV="dev" it works fine but when I set GENIE_ENV="prod" it doesn't load app.jl.html showing only "build with Genie" whereas the repl shows that all the computations are done.

maybe it's something off with socket connect can you open it again in diff browser/reload page? It should load

@abhimanyuaryan For context, I am running it in the docker container. I tried it in Safari as well as Chrome. They both don't work. Here the relevant environment set up in the Dockerfile.
RUN julia --project make.jl
# ports
EXPOSE 8000
EXPOSE 80
# set up app environment
ENV JULIA_DEPOT_PATH "/home/genie/.julia"
ENV JULIA_REVISE = "off"
ENV GENIE_ENV "prod"
ENV GENIE_HOST "0.0.0.0"
ENV PORT "8000"
ENV WSPORT "8000"
ENTRYPOINT ["julia", "--project", "--sysimage=sysimg.so", "-e", "using GenieFramework; Genie.loadapp(); Genie.Generator.write_secrets_file(\".\"); up(async=false);"]```

@abhimanyuaryan any insight?

could you please share me MWE(minimum working example) that I can run a test with this docker file?

Hare are all the files
# Dockerfile
# pull latest julia image
FROM --platform=linux/amd64 julia:latest
# create dedicated user
RUN useradd --create-home --shell /bin/bash genie
# set up the app
RUN mkdir /home/genie/app
COPY . /home/genie/app
WORKDIR /home/genie/app
# C compiler for PackageCompiler
RUN apt-get update && apt-get install -y g++
# configure permissions
RUN chown -R genie:genie /home/
# create genie user
USER genie
# instantiate Julia packages
RUN julia -e "using Pkg; Pkg.activate(\".\"); Pkg.instantiate(); Pkg.precompile();"
# Compile app
RUN julia --project make.jl
# ports
EXPOSE 8000
EXPOSE 80
# set up app environment
ENV JULIA_DEPOT_PATH "/home/genie/.julia"
ENV JULIA_REVISE = "off"
ENV GENIE_ENV "prod"
ENV GENIE_HOST "0.0.0.0"
ENV PORT "8000"
ENV WSPORT "8000"
# ENV EARLYBIND "true"
ENTRYPOINT ["julia", "--project", "--sysimage=sysimg.so", "-e", "using GenieFramework; Genie.loadapp(); up(async=false);"]```
Here is the `app.jl`
```julia
module App
# importing Julia packages
using GenieFramework
using DataFrames, Dates
# loading genie tools
@genietools
const private_params = Ref(params())
@private private_params
# Stipple.Observables.to_value(prp)
@app begin
# @private const prp = Ref(params())
@out version = "v0.1.2"
end
function ui()
@show "ui is loaded"
private_params[] = Genie.Router.params()
read("app.jl.html", String)
end
route("/") do
# model = @init
@page(
"/", ui,
Stipple.ReactiveTools.DEFAULT_LAYOUT(title = "Stress Metrics (Vulnerability)"),
)
end
end```

Here is the app.jl.html
<h1>Analysis <q-badge :label="version"></q-badge></h1>
<div class="row">
<div class="st-col col-2 st-module">
<h2>Configuration</h2>
<div class="row">
<div class="col col-12">
<h4 id="i61pk">Topology</h4>
</div>
</div>
</div>
<div class="st-col col-8 st-module">
<h2>Analysis</h2>
<div class="row">
<div class="col col-12">
<h4 id="iwh7j">Net Vulnerability Plot</h4>
<div class="col col-4 col-sm">
</div>
<p style="color:tomato" v-text="plot_message">Default content</p>
</div>
</div>
<div class="row">
<div class="col col-12">
<h4 id="iok84">Vulnerability Table</h4>
<p>The impacts column represents the impact </p>
<p style="color:tomato" v-text="table_message">Default content</p>
</div>
</div>
</div>
</div>```

Here is make.jl
# make.jl
using PackageCompiler
include("packages.jl")
PackageCompiler.create_sysimage(
PACKAGES,
sysimage_path = "sysimg.so",
cpu_target = PackageCompiler.default_app_cpu_target()
)```

Here is packages.jl
# packages.jl
const PACKAGES = [
"GenieFramework",
"DataFrames",
"Dates",
"Genie",
"Inflector",
"Logging",
"Pkg",
"TimeZones",
"WeakRefStrings",
"HTTP",
]```

thanks will take a look

I don't know why would you do that?
function ui()
@show "ui is loaded"
private_params[] = Genie.Router.params()
read("app.jl.html", String)
end
route("/") do
# model = @init
@page(
"/", ui,
Stipple.ReactiveTools.DEFAULT_LAYOUT(title = "Stress Metrics (Vulnerability)"),
)
end
You should just use @page
macro

Why are you using params()
what's the use?

if you want private fields. Use @private
macro

just trying to understand your approach. What's your goal because this is not recommended approach also where did you find this i.e. wrapping @page
in route
?

I am using params because I want to have the option to access the page with url params that will have the fields filled

What would be the best way to do it?

Here I found this approach: https://discord.com/channels/774897545717219328/1044349952618410034

@abhimanyuaryan any insight on what approach to use for accessing GET query params? I am also interested in url sync with updated react fields, if you can point me to an example or help would be greatly appreciated.

no I haven't had change sorry. Very busy lately. Tomorrow I'll look into it. Sorry for delay

@abhimanyuaryan Any insgiht on this?

@Pere can you please check this. I am busy for at least another 20 days