Skip to content

Commit

Permalink
Docker and Functional Travis-CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLoneRonin committed Jan 4, 2021
1 parent 179c020 commit c319115
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 10 deletions.
36 changes: 27 additions & 9 deletions .travis.yml
@@ -1,16 +1,34 @@
os: linux
dist: focal
language: erlang

otp_release:
- 22.2.4

addons:
apt:
packages:
- sqlite3

install:
- epmd -daemon
otp_release:
- 22.2
# blocklist
branches:
except:
- master
# AR UT
script:
- ./bin/test

jobs:
include:
- name: arweave-docker
services:
- docker
script:
- sudo apt-get update
- sudo apt-get install apt-utils build-essential g++ clang gcc -y
- docker build -t arweave .

- name: arweave-source
script:
- sudo apt-get update
- sudo apt-get install apt-utils build-essential g++ clang gcc -y
- sudo apt-get cmake make -y
- git submodule init
- git submodule update
- ./rebar3 as prod tar
- ./bin/test
26 changes: 26 additions & 0 deletions Dockerfile
@@ -0,0 +1,26 @@
FROM erlang:22.2.4

LABEL maintainer="Arweave Team <hello@arweave.org>"

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app
COPY . .

RUN apt-get update
RUN apt-get install apt-utils -y
RUN apt-get install build-essential -y
RUN apt-get install g++ clang gcc -y
RUN apt-get install git -y
RUN apt-get install cmake -y
RUN apt-get install make -y
RUN apt-get install libsqlite3-dev -y
RUN apt-get install erlang-dev -y

RUN git submodule init
RUN git submodule update

RUN ./rebar3 as prod tar
RUN ulimit -n 10240

CMD ["/bin/bash"]
34 changes: 34 additions & 0 deletions README.md
Expand Up @@ -34,6 +34,40 @@ $ ./rebar3 as prod tar

You will then find the gzipped tarball at `_build/prod/rel/arweave/arweave-x.y.z.tar.gz`.

## Building with Docker

As an alternative you can build the project with Docker. In order to compile the project, you will need to run.

```bash
docker build -t arweave .
```

If the build is successful, you can then start a new Docker container. In order for Arweave to work, you **must** specify the `--network host` flag.

Furthermore, you will need to specify a volume. The volume should be on a disk that can hold several TB worth of data. Ideally any NAS or SSD with +5TB worth of storage. This will require specifying a volume with the `--mount` or `-v` flag.

If you need to configre your volume differently, check out the documentation on [Docker Volumes](https://docs.docker.com/storage/volumes/) here.

The following is an example command you can run to start an Arweave instance.

```bash
docker run \
--it \
--network host arweave \
--mount 'type=volume,src=arweave-volume,dst=[your/drive/folder],volume-driver=local,volume-opt=type=nfs,volume-opt=device=<nfs-server>:<nfs-path>,"volume-opt=o=addr=<nfs-address>,vers=4,soft,timeo=180,bg,tcp,rw"' \
--name arweave-instance
```

Once completed, you can then start interacting with the project in both the production and development environments.

```bash
# For development
./bin/start-dev --help

# For production
./_build/prod/rel/arweave/bin/start --help
```

# Running a gateway

To run a gateway, consult the [gateway setup guide](doc/gateway_setup_guide.md).
Expand Down
2 changes: 1 addition & 1 deletion rebar.lock
Expand Up @@ -24,7 +24,7 @@
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.7.1">>},1},
{<<"rocksdb">>,
{git,"https://gitlab.com/arweave1/erlang-rocksdb.git",
{ref, "09ba3a9016528ae7466a824d04a3d6ff479537b1"}},
{ref,"09ba3a9016528ae7466a824d04a3d6ff479537b1"}},
0}]}.
[
{pkg_hash,[
Expand Down

0 comments on commit c319115

Please sign in to comment.