Skip to content

Commit

Permalink
Merge pull request #36 from filedag-project/feat/milestone3
Browse files Browse the repository at this point in the history
Feat/milestone3
  • Loading branch information
qianhh authored Dec 28, 2022
2 parents 09115af + 13b5bea commit 42d5dfe
Show file tree
Hide file tree
Showing 55 changed files with 4,094 additions and 704 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
docs
default.etcd
*.gz
*.tar.gz
*.bzip2
*.zip
/dn-data
/dp-data
/store-data
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/dagpool
/datanode
/objectstore
/dp-data
/dn-data
/store-data
/dp-data
/store-data
/iam-tools
27 changes: 27 additions & 0 deletions Dockerfile.dagpool
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:1.19.3-alpine AS builder

LABEL stage=gobuilder

ENV CGO_ENABLED 0
ENV GOOS linux
ENV GOPROXY https://goproxy.cn,direct

WORKDIR /build
COPY . .
RUN go mod download

# Builds your app with optional configuration
RUN go build -ldflags "-s -w" -o dagpool ./cmd/dagpool

FROM scratch

WORKDIR /app
COPY --from=builder /build/dagpool /app/dagpool

# Tells Docker which network port your container listens on
EXPOSE 50001

ENTRYPOINT ["/app/dagpool"]

# Specifies the executable command that runs when the container starts
CMD ["daemon", "--datadir=/data"]
27 changes: 27 additions & 0 deletions Dockerfile.datanode
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:1.19.3-alpine AS builder

LABEL stage=gobuilder

ENV CGO_ENABLED 0
ENV GOOS linux
ENV GOPROXY https://goproxy.cn,direct

WORKDIR /build
COPY . .
RUN go mod download

# Builds your app with optional configuration
RUN go build -ldflags "-s -w" -o datanode ./cmd/datanode

FROM scratch

WORKDIR /app
COPY --from=builder /build/datanode /app/datanode

# Tells Docker which network port your container listens on
EXPOSE 9010

ENTRYPOINT ["/app/datanode"]

# Specifies the executable command that runs when the container starts
CMD ["daemon", "--datadir=/data"]
27 changes: 27 additions & 0 deletions Dockerfile.objectstore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:1.19.3-alpine AS builder

LABEL stage=gobuilder

ENV CGO_ENABLED 0
ENV GOOS linux
ENV GOPROXY https://goproxy.cn,direct

WORKDIR /build
COPY . .
RUN go mod download

# Builds your app with optional configuration
RUN go build -ldflags "-s -w" -o objectstore ./cmd/objectstore

FROM scratch

WORKDIR /app
COPY --from=builder /build/objectstore /app/objectstore

# Tells Docker which network port your container listens on
EXPOSE 9985

ENTRYPOINT ["/app/objectstore"]

# Specifies the executable command that runs when the container starts
CMD ["daemon", "--datadir=/data"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ DATANODE_TARGET=./datanode
OBJECTSTORE_TARGET=./objectstore
IAMTOOLS_TARGET=./iam-tools

#VERSION ?= $(shell git describe --tags)
#TAG_DATANODE ?= "filedag/datanode:$(VERSION)"
TAG_DATANODE ?= "filedag/datanode:latest"
TAG_DAGPOOL ?= "filedag/dagpool:latest"
TAG_OBJECTSTORE ?= "filedag/objectstore:latest"

build: clean dagpool datanode objectstore iamtools

dagpool:
Expand All @@ -19,6 +25,18 @@ objectstore:
iamtools:
go build -ldflags "-s -w" -o ${IAMTOOLS_TARGET} ./cmd/tools/iam-tools

docker-datanode:
docker build -q --no-cache -t $(TAG_DATANODE) . -f Dockerfile.datanode

docker-dagpool:
docker build -q --no-cache -t $(TAG_DAGPOOL) . -f Dockerfile.dagpool

docker-objectstore:
docker build -q --no-cache -t $(TAG_OBJECTSTORE) . -f Dockerfile.objectstore

docker: docker-datanode docker-dagpool docker-objectstore
docker buildx prune -f

.PHONY: clean
clean:
-rm -f ${DAGPOOL_TARGET}
Expand Down
19 changes: 12 additions & 7 deletions README-cn.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FileDAG Storage

[![LICENSE](https://img.shields.io/github/license/filedag-project/filedag-storage)](./LICENSE "LICENSE")
[![Build Status](https://img.shields.io/github/workflow/status/filedag-project/filedag-storage/Go)]()
[![Build Status](https://img.shields.io/github/actions/workflow/status/filedag-project/filedag-storage/go.yml)]()

Language: [English](./README.md)

Expand Down Expand Up @@ -78,12 +78,12 @@ FileDAG Storage 的开发将为上述问题提供一种解决方案
#### Description:

- DAG Node:
- 基于Reed-Solomon Erasure Code开发数据容错技术
- [x] 基于Reed-Solomon Erasure Code开发数据容错技术
- DAG Pool:
- 基于libp2p和Redis Hash Slots,组织多个DAG Node构建存储集群
- 提供存储节点的运行状况报告和全局一致性状态
- 支持存储节点动态扩容
- 支持存储节点动态扩展
- [x] 基于Redis Hash Slots,组织多个DAG Node构建存储集群
- [x] 提供存储节点的运行状况报告和全局一致性状态
- [x] 支持存储节点动态扩容
- [x] 支持存储节点动态扩展

### Milestone 4

Expand Down Expand Up @@ -127,7 +127,12 @@ make

./datanode daemon --listen=127.0.0.1:9013 --datadir=/tmp/dn-data3

./dagpool daemon --datadir=/tmp/dagpool-db --config=conf/node_config.json
./dagpool daemon --datadir=/tmp/dagpool-db

# add a dagnode
./dagpool cluster add conf/node_config.json
# allocate slots
./dagpool cluster balance

./objectstore daemon --pool-addr=127.0.0.1:50001 --pool-user=dagpool --pool-password=dagpool
```
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FileDAG Storage

[![LICENSE](https://img.shields.io/github/license/filedag-project/filedag-storage)](./LICENSE "LICENSE")
[![Build Status](https://img.shields.io/github/workflow/status/filedag-project/filedag-storage/Go)]()
[![Build Status](https://img.shields.io/github/actions/workflow/status/filedag-project/filedag-storage/go.yml)]()

Language: [Chinese](./README-cn.md)

Expand Down Expand Up @@ -77,12 +77,12 @@ Realize clustered DAG Node and development of data fault tolerance.
#### Description:

- DAG Node:
- develops data fault tolerance based on Reed-Solomon Erasure Code
- [x] develops data fault tolerance based on Reed-Solomon Erasure Code
- DAG Pool:
- organizes multiple DAG Nodes to build a storage cluster based on libp2p and Redis Hash Slots
- provides health report of storage nodes and status of global consistency
- supports dynamic expansion of storage nodes
- supports dynamic scaling of storage nodes
- [x] organizes multiple DAG Nodes to build a storage cluster based on Redis Hash Slots
- [x] provides health report of storage nodes and status of global consistency
- [x] supports dynamic expansion of storage nodes
- [x] supports dynamic scaling of storage nodes

### Milestone 4

Expand Down Expand Up @@ -126,7 +126,12 @@ Start 3 datanodes, dagpool and objectstore:

./datanode daemon --listen=127.0.0.1:9013 --datadir=/tmp/dn-data3

./dagpool daemon --datadir=/tmp/dagpool-db --config=conf/node_config.json
./dagpool daemon --datadir=/tmp/dagpool-db

# add a dagnode
./dagpool cluster add conf/node_config.json
# allocate slots
./dagpool cluster balance

./objectstore daemon --pool-addr=127.0.0.1:50001 --pool-user=dagpool --pool-password=dagpool
```
Expand Down
Loading

0 comments on commit 42d5dfe

Please sign in to comment.