Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
feat(web): add web ui (#3)
Browse files Browse the repository at this point in the history
* feat(web): add web ui

* added router support and minimal css framework

* not a bad ui for v0

* remove favicon

* add note to docs and redirect to ui by default
  • Loading branch information
mjpitz committed Oct 14, 2021
1 parent 1ed939b commit 7daba44
Show file tree
Hide file tree
Showing 46 changed files with 13,902 additions and 342 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/api/
/charts/**/Chart.lock
/charts/**/*.tgz
/dist/
/gen/
/vendor/
/docs/openapiv2/
/out/

/dist/
/internal/web/
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ builds:
- amd64
- arm64
hooks:
post: make .proto-tar VERSION={{ .Version }}
post: ./scripts/dist-proto.sh

archives:
- id: aetherfs
Expand Down
10 changes: 3 additions & 7 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Each component of the architecture provides a REST and gRPC interface for commun
internal components, these interfaces can be used by calling applications as well. However, AetherFS expects callers to
interact with one of our other interfaces as they abstract away the complexity of the underlying storage.

For the most part, AetherFS's interfaces are inspired by Docker and Git.
For the most part, AetherFS's interfaces are inspired by Docker and Git. All REST routes sit under the `/api` prefix.

**DatasetAPI**

Expand All @@ -156,23 +156,19 @@ complete list of files within the dataset, their sizes, and last modified timest
of blocks that are required to construct the dataset. Using these components, clients can piece together the underlying
files.

All REST routes sit under the `/v1/datasets` prefix.

**BlockAPI**

The `BlockAPI` gives callers direct access to the block data. You must use the `DatasetAPI` to obtain block references.
The `BlockAPI` does not provide callers with the ability to list blocks (intentional design decision). An entire block
can be read at a time, or just part of one.

All REST routes sit under the `/v1/blocks` prefix.

#### HTTP File Server

Using [Golang's http.FileServer][], AetherFS was able to provide a quick prototype of a FileSystem implementation. Using
[HTTP range requests][], callers are able to read segments of large files that may be too large to fit in memory all at
once. Agents can still make use of caching to keep the data local to the process.

This currently resides under the `/v1/fs` prefix.
This currently resides under the `/fs` prefix.

[Golang's http.FileServer]: https://pkg.go.dev/net/http#FileServer
[HTTP range requests]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests
Expand All @@ -183,7 +179,7 @@ This currently resides under the `/v1/fs` prefix.

#### Web

<!-- todo -->
A web interface is available under the `/ui` prefix.

### Configuration

Expand Down
70 changes: 32 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,64 @@ Welcome to aetherfs!

Targets:
help provides help text
dist recompiles aetherfs binaries

docker rebuild the aetherfs docker container
docker/devtools rebuild docker container containing developer tools
gen regenerate the API code from protocol buffers
docker/shell spins up an interactive shell with all dev tools
in-docker run targets in docker (useful to avoid local deps)

legal prepends legal header to source code
release releases aetherfs
gen regenerate the API code from protocol buffers
dist recompiles aetherfs binaries
release releases aetherfs (will likely move)

endef
export HELP_TEXT

help:
@echo "$$HELP_TEXT"

legal: .legal
.legal:
addlicense -f ./legal/header.txt -skip yaml -skip yml .
docker: .docker
.docker:
docker build . \
--tag $(SKAFFOLD_DEFAULT_REPO)/aetherfs:latest \
--tag $(SKAFFOLD_DEFAULT_REPO)/aetherfs:$(VERSION) \
--file ./docker/aetherfs/Dockerfile

docker/devtools: .docker/devtools
.docker/devtools:
docker build ./docker/devtools -t $(SKAFFOLD_DEFAULT_REPO)/aetherfs-devtools

gen: .gen
.gen:
@rm -rf api gen
in-docker:
docker run --rm -it \
-v $(CWD):/home \
-w /home \
$(SKAFFOLD_DEFAULT_REPO)/aetherfs-devtools \
sh -c 'buf lint && buf generate'
make $(TARGETS)

dist: .dist
.dist:
docker/shell: .docker/shell
.docker/shell:
docker run --rm -it \
-v $(CWD):/home \
-w /home \
$(SKAFFOLD_DEFAULT_REPO)/aetherfs-devtools \
sh -c "goreleaser --snapshot --skip-publish --rm-dist"
sh

docker: .docker
.docker:
docker build . \
--tag $(SKAFFOLD_DEFAULT_REPO)/aetherfs:latest \
--tag $(SKAFFOLD_DEFAULT_REPO)/aetherfs:$(VERSION) \
--file ./docker/aetherfs/Dockerfile
# actual targets

shell:
docker run --rm -it \
-v $(CWD):/home \
-w /home \
$(SKAFFOLD_DEFAULT_REPO)/aetherfs-devtools \
sh
legal: .legal
.legal:
addlicense -f ./legal/header.txt -skip yaml -skip yml docker internal proto scripts web/public web/src

gen: .gen
.gen:
./scripts/buf.sh

dist: .dist
.dist:
./scripts/dist-web.sh
make legal
./scripts/dist-go.sh

# release - used to generate core release assets such as binaries and container images.

Expand All @@ -74,16 +81,3 @@ release:
--tag $(SKAFFOLD_DEFAULT_REPO)/aetherfs:$(VERSION) \
--file ./docker/aetherfs/Dockerfile \
--push

# proto-tar - invoked from goreleaser to produce a tar.gz of proto files for the version.
# todo: use bufs image concept

PROTO = $(PWD)/proto
DIST = $(PWD)/dist

.proto-tar:
[[ -d "$(DIST)/aetherfs_proto" ]] || { \
mkdir -p $(DIST)/aetherfs_proto; \
cp -R $(PROTO)/* $(DIST)/aetherfs_proto; \
tar -czf $(DIST)/aetherfs_proto.tar.gz -C $(DIST)/aetherfs_proto/ . ; \
}
27 changes: 27 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3.8"

services:
minio:
image: minio/minio
ports:
- 9000:9000
- 9090:9090
command:
- server
- /data
- --console-address
- ":9090"

server:
image: ${SKAFFOLD_DEFAULT_REPO:-ghcr.io/mjpitz}/aetherfs
ports:
- 8080:8080
environment:
STORAGE_DRIVER: s3
STORAGE_S3_ENDPOINT: minio:9000
STORAGE_S3_ACCESS_KEY_ID: minioadmin
STORAGE_S3_SECRET_ACCESS_KEY: minioadmin
STORAGE_S3_BUCKET: aetherfs-data
command:
- run
- hub
11 changes: 9 additions & 2 deletions docker/devtools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM ubuntu:21.04

ARG GO_VERSION=1.16.4
ARG PROTOC_VERSION=3.15.7
ARG NODE_VERSION=14.18.1

RUN apt-get update -y && apt-get install -y curl unzip gnupg2 git build-essential

Expand All @@ -16,7 +17,12 @@ RUN curl -sSLo protoc.zip https://github.com/protocolbuffers/protobuf/releases/d
unzip -d /usr/local/protoc protoc.zip && \
rm protoc.zip

ENV PATH="/usr/local/go/bin:/usr/local/protoc/bin:${PATH}"
RUN curl -sSLo node.tar.xz https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz && \
tar -C /usr/local -Jxf node.tar.xz && \
rm node.tar.xz && \
mv /usr/local/node-v${NODE_VERSION}-linux-x64 /usr/local/node

ENV PATH="/usr/local/go/bin:/usr/local/protoc/bin:/usr/local/node/bin:${PATH}"

ENV GO111MODULE=on

Expand All @@ -29,4 +35,5 @@ RUN GOBIN=/usr/local/bin go get \
google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 \
github.com/envoyproxy/protoc-gen-validate@v0.6.1 \
github.com/goreleaser/goreleaser@v0.177.0
github.com/goreleaser/goreleaser@v0.177.0 \
moul.io/protoc-gen-gotemplate@v1.11.2
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ download new or updated portions.
This project is under active development. The lists below detail aspirational features and documentation.

- Documentation
- Architecture Document
- [Architecture Document](https://github.com/mjpitz/aetherfs/blob/main/ARCHITECTURE.md)
- Features
- HTTP file server for ease of interaction
- REST and gRPC APIs for programmatic interaction
Expand Down Expand Up @@ -56,6 +56,7 @@ This will be the initial release of AetherFS. It includes the "essentials".
- Command to run an AetherFS data hub.
- Command to upload to and tag datasets in AetherFS.
- Command to download tagged datasets from AetherFS.
- Minimal web interface.
- Data encrypted in transit.

### v22.02
Expand Down
Loading

0 comments on commit 7daba44

Please sign in to comment.