Skip to content
Permalink
Browse files

Help people find Elm-fullstack

Move to https://github.com/elm-fullstack/elm-fullstack
It looks like Kalmit will have a separate repository.
For now, the tests now run at https://dev.azure.com/kalmit/elm-fullstack/
Github shows links to the test results on the commit view.
  • Loading branch information
Viir committed Oct 1, 2019
1 parent f6e46ee commit caf8647744b5f9e20b571562b3b82e3270cb5ac5
@@ -15,9 +15,3 @@ Common, non-application specific functionality is implemented in the Elm-fullsta

For how to build from Elm code and configure optional features, see the guide on [how to configure and deploy your Elm full-stack app](guide/how-to-configure-and-deploy-your-elm-full-stack-app.md).

## CI Build Status

Platform | Status
--- | ---
| vs2017-win2016 | [![Build Status Windows](https://dev.azure.com/kalmit/kalmit/_apis/build/status/Kalmit%20Windows?branchName=master)](https://dev.azure.com/kalmit/kalmit/_build/latest?definitionId=2?branchName=master) |
| ubuntu-16.04 | [![Build Status Linux](https://dev.azure.com/kalmit/kalmit/_apis/build/status/Kalmit%20Linux?branchName=master)](https://dev.azure.com/kalmit/kalmit/_build/latest?definitionId=3?branchName=master) |
@@ -10,7 +10,7 @@

+ Support integrating app to configure tradeoff between the cost of persisting and cost of restoring.
+ Reduce load on storage: Provide automation to remove reductions which are not needed anymore from the store.
+ Add information in the admin section on the web host at `/kalmit-admin`. This seems a good place to inform about available options. Illustrate how to set the process state.
+ Add information in the admin section on the web host at `/elm-fullstack-admin`. This seems a good place to inform about available options. Illustrate how to set the process state.

### Collaboration

@@ -84,20 +84,20 @@ As long as the `UseStaging` property is set to `true`, the app gets the SSL cert
## Set a Password for the Admin Interface
In case you want to use the admin interface, you can set it using the environment variable `APPSETTING_adminRootPassword`. The username is `root`.
You can use these credentials for example at https://your-domain.com/kalmit-admin/api/process/state to inspect or set the process state.
You can use these credentials for example at https://your-domain.com/elm-fullstack-admin/api/process/state to inspect or set the process state.
When using Docker, you can set the environment variable when creating a container as follows:
```cmd
docker run -p 80:80 --env "APPSETTING_adminRootPassword=secret" kalmit/kalmit-web-app
docker run -p 80:80 --env "APPSETTING_adminRootPassword=secret" elmfullstack/elm-fullstack
```
For more details about environment variables in docker, see https://docs.docker.com/engine/reference/run/#env-environment-variables
## Manage the Process Store
The process store contains not only the latest state of the app but also the event log.
In the Docker image `kalmit/kalmit-web-app`, the process store is located in the directory `/kalmit/process-store`.
In the Docker image `elmfullstack/elm-fullstack`, the process store is located in the directory `/elm-fullstack/process-store`.
You can copy this directory to backup the process store or copy it to another container.
Alternatively, use a [docker volume](https://docs.docker.com/storage/volumes/) to map this directory to another location:
```powershell
docker run --mount source=your-docker-volume-name,destination=/kalmit/process-store -p 80:80 kalmit/kalmit-web-app
docker run --mount source=your-docker-volume-name,destination=/elm-fullstack/process-store -p 80:80 elmfullstack/elm-fullstack
```
@@ -23,7 +23,7 @@ During operation of the process, the system records the sequence of events (some

On startup, the Elm-fullstack web host uses the composition log to restore the process state. It reads the sequence of events and replays the updates to compose the process state again.

For an automated test covering the restoration of the process state, see the [method `Restore_process_state_over_compositions` in the implementation](https://github.com/Viir/Kalmit/blob/512bea42674f6d214745c73af8d20c52bca096f6/implement/PersistentProcess/PersistentProcess.Test/TestPersistentProcess.cs#L111-L153).
For an automated test covering the restoration of the process state, see the [method `Restore_process_state_over_compositions` in the implementation](https://github.com/elm-fullstack/elm-fullstack/blob/512bea42674f6d214745c73af8d20c52bca096f6/implement/PersistentProcess/PersistentProcess.Test/TestPersistentProcess.cs#L111-L153).

### Optimizing for Faster Restore

@@ -32,4 +32,4 @@ Besides the time it takes for replaying the composition, a growing composition c

To solve both the restore time and storage space problems, Elm-fullstack also stores reductions of the composition chain at regular intervals. The reduced value equals the process state derived from the reduced composition chain. When performing a restore, the composition chain is not anymore read back to the beginning of history, but only up to the last written and available reduction record. Since the earlier part of the composition log is not needed anymore for restoration, it can be truncated, freeing up storage space.

The automated test [`Restore_process_state_from_combination_of_reduction_and_compositions` in the implementation](https://github.com/Viir/Kalmit/blob/512bea42674f6d214745c73af8d20c52bca096f6/implement/PersistentProcess/PersistentProcess.Test/TestPersistentProcess.cs#L155-L220) demonstrates the recovery of process states from truncated composition logs, with the help of reductions.
The automated test [`Restore_process_state_from_combination_of_reduction_and_compositions` in the implementation](https://github.com/elm-fullstack/elm-fullstack/blob/512bea42674f6d214745c73af8d20c52bca096f6/implement/PersistentProcess/PersistentProcess.Test/TestPersistentProcess.cs#L155-L220) demonstrates the recovery of process states from truncated composition logs, with the help of reductions.
@@ -10,26 +10,26 @@ RUN dotnet publish -c Debug -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS binaries

COPY --from=build-env /app/PersistentProcess.WebHost/out /kalmit/dotnet/
COPY --from=build-env /app/PersistentProcess.WebHost/out /elm-fullstack/dotnet/

# Build the `web-app-config.zip` for the default app.
FROM binaries AS build-default-config

COPY ./example-elm-apps/default-full-stack-app /default-app/

WORKDIR /default-app
RUN dotnet "/kalmit/dotnet/PersistentProcess.WebHost.dll" build-config --frontend-web-elm-source="elm-app/src/FrontendWeb/Main.elm" --output="/build-output/web-app-config.zip"
RUN dotnet "/elm-fullstack/dotnet/PersistentProcess.WebHost.dll" build-config --frontend-web-elm-source="elm-app/src/FrontendWeb/Main.elm" --output="/build-output/web-app-config.zip"

# Reduce startup cost: Produce an image which has popular blobs already in cache: Continue with state after having built a configuration.
FROM build-default-config AS with-default-app

COPY --from=build-default-config /build-output/web-app-config.zip /kalmit/
COPY --from=build-default-config /build-output/web-app-config.zip /elm-fullstack/

WORKDIR /kalmit
WORKDIR /elm-fullstack

ENV APPSETTING_webAppConfigurationFilePath="/kalmit/web-app-config.zip"
ENV APPSETTING_processStoreDirectoryPath="/kalmit/process-store"
ENV APPSETTING_webAppConfigurationFilePath="/elm-fullstack/web-app-config.zip"
ENV APPSETTING_processStoreDirectoryPath="/elm-fullstack/process-store"

ENTRYPOINT ["dotnet", "/kalmit/dotnet/PersistentProcess.WebHost.dll"]
ENTRYPOINT ["dotnet", "/elm-fullstack/dotnet/PersistentProcess.WebHost.dll"]

# ENV APPSETTING_adminRootPassword="password-for-kalmit-root"
# ENV APPSETTING_adminRootPassword="password-for-elm-fullstack-root"
@@ -7,7 +7,7 @@ namespace Kalmit.PersistentProcess.WebHost
{
static public class Configuration
{
static public string AdminPath => "/kalmit-admin";
static public string AdminPath => "/elm-fullstack-admin";

static public string ApiPersistentProcessStatePath => "/api/process/state";

@@ -38,7 +38,7 @@ processEvent hostEvent stateBefore =
, bodyAsString =
Just
("You are seeing the default configuration for the web app."
++ "\nFor information on how to configure the web app, see https://github.com/Viir/Kalmit"
++ "\nFor information on how to configure the web app, see https://github.com/elm-fullstack/elm-fullstack"
++ "\nThis web app received "
++ (state.httpRequestsCount |> String.fromInt)
++ " HTTP requests."
@@ -1,7 +1,7 @@
{
"mapsFromRequestUrlToStaticFileName": [
{
"matchingRegexPattern": "^.*//[^/]+(|/(?!api/).*)$",
"matchingRegexPattern": "^.*//[^/]+(|/(?!(api/|elm-fullstack-admin/)).*)$",
"resultString": "FrontendWeb.html"
}
]
@@ -1,7 +1,7 @@
# Since it only uses Docker commands, we can run this script on both Windows and Linux.

docker build --tag kalmit-test .
docker build --tag elm-fullstack-test .

docker stop kalmit-test-container
docker stop fullstack-test-container

docker run --rm -p 80:80 -p 443:443 --name kalmit-test-container --env "APPSETTING_adminRootPassword=notempty" kalmit-test
docker run --rm -p 80:80 -p 443:443 --name fullstack-test-container --env "APPSETTING_adminRootPassword=notempty" elm-fullstack-test

0 comments on commit caf8647

Please sign in to comment.
You can’t perform that action at this time.