lattenwald / highloadcup.ru

Solution for highloadcup.ru contest

Home Page:https://highloadcup.ru/round/1/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Round1

This is a solution for highloadcup.ru.

Technology

I am using Elixir. Not actually using there Elixir-specific stuff, so you could say it's just Erlang.

Data is stored in ets, there's some data redundancy to avoid :ets.selects, which are too slow. No extra caching or any hardcore optimizations.

elli is doing all the serving; JSON is done with jiffy.

Building image

Ubuntu

% docker build -f Dockerfile-ubuntu -t round1_ubuntu --build-arg bust="`date`" .

Alpine, you guessed right

% docker build -f Dockerfile-alpine -t round1_alpine --build-arg bust="`date`" .

bust argument is for bumping image, you can safely omit it if code actually changed.

Running image

First checkout the repo, go to TRAIN or FULL data (i.e., hlcupdocs/data/TRAIN/data) and create an archive

% zip data *json

Then you are set to go

% docker run -p 8080:80 -v /path/to/hlcupdocs/data/TRAIN/data/:/tmp/data/ -t round1_alpine

Replace path and tag with appropriate values.

Caveats

Alpine image doesn't work at highloadcup.ru.

About

Solution for highloadcup.ru contest

https://highloadcup.ru/round/1/


Languages

Language:Elixir 98.7%Language:Shell 1.3%