Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 20 additions & 35 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## on: [push, pull_request]
on:
pull_request:
paths-ignore:
Expand All @@ -7,41 +6,27 @@ on:
- 'assets/**'
- '**.md'

name: Continuous Integration
name: Parseable CI Workflow

jobs:
# docker:
# name: Docker Build & Push
# runs-on: ubuntu-latest
# steps:
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: |
# parseable/parseable
# tags: |
# type=sha
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push
# uses: docker/build-push-action@v3
# with:
# push: true
# tags: ${{ steps.meta.outputs.tags }}

test:
name: Test Suite
docker-compose-test:
name: Docker Compose integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
- name: Start compose
run: docker-compose -f "docker-compose.yaml" up --build
- name: Stop compose
if: always()
run: docker-compose -f "docker-compose.yaml" down

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -52,10 +37,10 @@ jobs:
command: test

fmt:
name: Rustfmt
name: Rust fmt check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -68,10 +53,10 @@ jobs:
args: --all -- --check

clippy:
name: Clippy
name: Cargo Clippy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 38 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,50 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

FROM rust:1.67.0 as builder

# Compile
FROM rust:1.67-alpine AS compiler

WORKDIR /parseable

RUN apk add --no-cache musl-dev

COPY . .

RUN cargo build --release

FROM gcr.io/distroless/cc:latest
RUN set -eux; \
apkArch="$(apk --print-arch)"; \
if [ "$apkArch" = "aarch64" ]; then \
export JEMALLOC_SYS_WITH_LG_PAGE=16; \
fi && \
cargo build --release

# Run
FROM alpine:3.16

RUN apk update --quiet \
&& apk add -q --no-cache tini

# Create appuser
ENV USER=parseable
ENV UID=10001

RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"

WORKDIR /parseable

COPY --from=builder /parseable/target/release/parseable /usr/local/bin/parseable
COPY --from=compiler /parseable/target/release/parseable /bin/parseable
RUN chown -R parseable /parseable/

USER parseable:parseable

EXPOSE 8000/tcp

CMD ["/usr/local/bin/parseable"]
ENTRYPOINT ["tini", "--"]
CMD /bin/parseable
47 changes: 0 additions & 47 deletions Dockerfile.release

This file was deleted.

34 changes: 0 additions & 34 deletions Dockerfile.static

This file was deleted.

39 changes: 14 additions & 25 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ services:
- parseable

parseable:
image: parseable/parseable:v0.2.1
build:
context: .
dockerfile: Dockerfile
command: ["parseable", "s3-store"]
ports:
- 8000
environment:
- P_S3_URL=http://minio:9000
- P_S3_ACCESS_KEY=parseable
- P_S3_SECRET_KEY=supersecret
- P_S3_REGION=us-east-1
- P_S3_BUCKET=parseable
- P_STAGING_DIR=/tmp/data
- P_USERNAME=admin
- P_PASSWORD=admin
- P_S3_URL="http://minio:9000"
- P_S3_ACCESS_KEY="parseable"
- P_S3_SECRET_KEY="supersecret"
- P_S3_REGION="us-east-1"
- P_S3_BUCKET="parseable"
- P_STAGING_DIR="/tmp/data"
- P_USERNAME="admin"
- P_PASSWORD="admin"
networks:
- parseable
healthcheck:
Expand All @@ -53,8 +55,8 @@ services:
depends_on:
- minio

quest-smoke:
image: parseable/quest:v0.1
quest:
image: ghcr.io/parseablehq/quest:main
command: ["smoke", "http://parseable:8000", "admin", "admin"]
networks:
- parseable
Expand All @@ -64,17 +66,4 @@ services:
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 10

quest-load:
image: parseable/quest:v0.1
command: ["load", "http://parseable:8000", "admin", "admin"]
networks:
- parseable
depends_on:
- quest-smoke
deploy:
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 10
max_attempts: 3
2 changes: 2 additions & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ureq = { version = "2.6", features = ["json"] }
hex = "0.4"
itertools = "0.10"
xxhash-rust = { version = "0.8", features = ["xxh3"] }
xz2 = { version = "*", features=["static"] }
bzip2 = { version = "*", features=["static"] }

[build-dependencies]
static-files = "0.2"
Expand Down