Skip to content

Commit

Permalink
Merge branch 'release/0.4.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Mar 26, 2022
2 parents 51a5af9 + cc0a468 commit eeaa17f
Show file tree
Hide file tree
Showing 31 changed files with 870 additions and 30 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,26 @@ jobs:
file: deploy/Dockerfile
tags: s3rius/rustus:latest,s3rius/rustus:${{env.APP_VERSION}}

release_helm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.7.1
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: ./deploy
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

publish_crate:
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,14 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install nightly toolchain
run: rustup toolchain install nightly --component llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --features=all,integration_tests --lcov --output-path lcov.info -- --test-threads 1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run tests
run: cargo test --features=all,integration_tests -- --test-threads 1
env:
TEST_REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/0
TEST_DB_URL: postgresql://rustus:rustus@localhost:${{ job.services.pg.ports['5432'] }}/rustus
TEST_AMQP_URL: amqp://guest:guest@localhost:${{ job.services.rabbit.ports['5672'] }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
45 changes: 40 additions & 5 deletions Cargo.lock

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

23 changes: 21 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustus"
version = "0.4.7"
version = "0.4.8"
edition = "2021"
description = "TUS protocol implementation written in Rust."
keywords = [
Expand Down Expand Up @@ -31,6 +31,24 @@ thiserror = "^1.0"
url = "^2.2.2"
bytes = "^1.1.0"

[dependencies.digest]
version = "0.10.3"
optional = true

[dependencies.sha1]
version = "^0.10.1"
features = ["compress"]
optional = true

[dependencies.sha2]
version = "^0.10.1"
features = ["compress"]
optional = true

[dependencies.md-5]
version = "^0.10.1"
optional = true

[dependencies.futures]
version = "^0.3.21"

Expand Down Expand Up @@ -108,12 +126,13 @@ features = ["v4"]
version = "^1.0.0-alpha.1"

[features]
all = ["redis_info_storage", "db_info_storage", "http_notifier", "amqp_notifier"]
all = ["redis_info_storage", "db_info_storage", "http_notifier", "amqp_notifier", "hashers"]
amqp_notifier = ["lapin", "tokio-amqp", "mobc-lapin"]
db_info_storage = ["rbatis", "rbson"]
default = []
http_notifier = ["reqwest"]
redis_info_storage = ["mobc-redis"]
hashers = ["md-5", "sha1", "sha2", "digest"]

### For testing
test_redis = []
Expand Down
2 changes: 1 addition & 1 deletion deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ COPY . .
RUN cargo build --release --bin rustus --features=all

FROM debian:bullseye-20211201-slim AS runtime
WORKDIR app
WORKDIR /app
COPY --from=builder /app/target/release/rustus /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/rustus"]
1 change: 1 addition & 0 deletions deploy/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ ADD "https://github.com/s3rius/rustus/releases/download/${app_version}/rustus-${
RUN tar xvf *.tar.gz
RUN rm *.tar.gz
RUN mv rustus /bin
WORKDIR /app

ENTRYPOINT ["/bin/rustus"]
23 changes: 23 additions & 0 deletions deploy/helm/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions deploy/helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 16.6.0
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.1.9
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 8.8.27
digest: sha256:96a4a257c98a0c8dbe07690d480dec99a1a73c5074e5e8811d6947e741eb9126
generated: "2022-03-24T14:49:00.598734768+04:00"
40 changes: 40 additions & 0 deletions deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: v2
name: rustus
description: A Helm chart for rustus
home: https://github.com/s3rius/rustus/
icon: https://raw.githubusercontent.com/s3rius/rustus/master/imgs/logo.svg
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.4.8"


dependencies:
- name: redis
version: ^16.0
condition: redis.enabled
repository: "https://charts.bitnami.com/bitnami"
- name: postgresql
version: ^11.0
condition: postgresql.enabled
repository: "https://charts.bitnami.com/bitnami"
- name: mysql
version: ^8.0
condition: mysql.enabled
repository: "https://charts.bitnami.com/bitnami"
Binary file added deploy/helm/charts/mysql-8.8.27.tgz
Binary file not shown.
Binary file added deploy/helm/charts/postgresql-11.1.9.tgz
Binary file not shown.
Binary file added deploy/helm/charts/redis-16.6.0.tgz
Binary file not shown.
22 changes: 22 additions & 0 deletions deploy/helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "rustus.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "rustus.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "rustus.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rustus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
Loading

0 comments on commit eeaa17f

Please sign in to comment.