Skip to content

Commit

Permalink
feat(s3): add S3 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: replaced actix with axum
  • Loading branch information
bogdan.vidrean committed Feb 15, 2024
1 parent 5dfc76c commit 404ffdb
Show file tree
Hide file tree
Showing 41 changed files with 2,542 additions and 1,494 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conventional-label.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

on:
pull_request:
Expand Down
37 changes: 31 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

# This workflow is triggered when semantic-release
# cretes a new tag in the repository.
Expand Down Expand Up @@ -40,8 +40,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
- name: Docker meta for the Dali image with the reqwest feature
id: meta-reqwest
uses: docker/metadata-action@v5
with:
flavor: latest=true
Expand All @@ -54,11 +54,36 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Build and push
- name: Build and push with the reqwest feature
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=reqwest
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta-reqwest.outputs.tags }}
labels: ${{ steps.meta-reqwest.outputs.labels }}

- name: Docker meta for the Dali image with the s3 feature
id: meta-s3
uses: docker/metadata-action@v5
with:
flavor: latest=true
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-s3
tags: |
# set latest tag for default branch
type=raw,value=latest,enable=false
type=raw,value=master,enable=false
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Build and push with the s3 feature
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=s3
push: true
tags: ${{ steps.meta-s3.outputs.tags }}
labels: ${{ steps.meta-s3.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr-title-with-feedback.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

# Attribution: https://github.com/amannn/action-semantic-pull-request/blob/v5.3.0/.github/workflows/lint-pr-title-preview-outputErrorMessage.yml
name: "Lint PR title preview with feedback"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

# Delete Docker images, caches and artifacts after PR merge
name: "Clean Up PR"
Expand Down
72 changes: 58 additions & 14 deletions .github/workflows/pull-requests-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,42 @@ jobs:
with:
args: docker restart backend
- name: Install build dependencies
run: apk add --update --no-cache
--repository https://dl-cdn.alpinelinux.org/alpine/v3.17/community
--repository https://dl-cdn.alpinelinux.org/alpine/v3.17/main
curl
musl-dev=1.2.3-r5
vips-dev=8.13.3-r1
vips-heif=8.13.3-r1
run: apk add --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.18/main
build-base=0.5-r3
clang=16.0.6-r1
clang16-libclang=16.0.6-r1
expat-dev=2.6.0-r0
giflib-dev=5.2.1-r4
glib-dev=2.76.6-r0
lcms2-dev=2.15-r2
libexif-dev=0.6.24-r1
libheif-dev=1.16.2-r0
libimagequant-dev=4.2.0-r0
libjpeg-turbo-dev=2.1.5.1-r3
libpng-dev=1.6.39-r3
librsvg-dev=2.56.3-r0
libwebp-dev=1.3.2-r0
openssl-dev=3.1.4-r5
orc-dev=0.4.34-r0
pkgconf=1.9.5-r0
tiff-dev=4.5.1-r0
tar
curl
- name: Install Libvips
run: |
wget https://github.com/libvips/libvips/releases/download/v8.13.3/vips-8.13.3.tar.gz
mkdir /vips
tar xvzf vips-8.13.3.tar.gz -C /vips --strip-components 1
cd /vips
./configure --enable-debug=no --without-OpenEXR --disable-static --enable-silent-rule
make
make install
rm -rf vips vips-8.13.3.tar.gz
- name: Check if nginx is available for files hosting
run: curl http://backend/exif --output /dev/null
# Cache needs the Cargo.lock file for the cache key and must come after the git checkout
- name: Set up cargo cache
uses: actions/cache@v3
uses: actions/cache@v4
continue-on-error: false
with:
path: |
Expand Down Expand Up @@ -102,23 +125,43 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata
- name: Docker metadata for the Dali image with the reqwest feature
if: github.event_name == 'pull_request' && github.repository == 'olxgroup-oss/dali'
id: meta
id: meta-reqwest
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ github.head_ref }}

- name: Build and push
- name: Build and push with the reqwest feature
if: github.event_name == 'pull_request' && github.repository == 'olxgroup-oss/dali'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=reqwest
push: true
tags: ${{ steps.meta-reqwest.outputs.tags }}
labels: ${{ steps.meta-reqwest.outputs.labels }}

- name: Docker metadata for the Dali image with the s3 feature
if: github.event_name == 'pull_request' && github.repository == 'olxgroup-oss/dali'
id: meta-s3
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-s3
tags: ${{ github.head_ref }}

- name: Build and push with the s3 feature
if: github.event_name == 'pull_request' && github.repository == 'olxgroup-oss/dali'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=s3
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta-s3.outputs.tags }}
labels: ${{ steps.meta-s3.outputs.labels }}

- name: Add package image comment to PR
if: github.event_name == 'pull_request' && github.repository == 'olxgroup-oss/dali'
Expand All @@ -132,5 +175,6 @@ jobs:
You can pull a preview container image of dali with the below command:
```console
docker pull ${{ steps.meta.outputs.tags }}
docker pull ${{ steps.meta-reqwest.outputs.tags }}
docker pull ${{ steps.meta-s3.outputs.tags }}
```
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

name: release

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml.off
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

name: build

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) Copyright 2019-2023 OLX
# (c) Copyright 2019-2024 OLX

/target
**/*.rs.bk
Expand Down
Loading

0 comments on commit 404ffdb

Please sign in to comment.