Skip to content

Commit

Permalink
Merge branch 'development/4.2' into dependabot/pip/requests-2.31.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet authored Mar 4, 2024
2 parents fbebcc1 + aa2a7b1 commit 960c711
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 55 deletions.
55 changes: 8 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,13 @@
name: release

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to be released'
required: true
prerelease:
description: "Is the release a GA?"
required: false
default: false
type: boolean

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v1
types: [published]

- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/scality/artifacts:${{ inputs.tag }}
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
generate_release_notes: true
target_commitish: ${{ github.sha }}
jobs:
docker:
uses: scality/workflows/.github/workflows/docker-build.yaml@v1
with:
name: artifacts
namespace: scality
tag: ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ RUN make install
# Install start scripts
COPY full_listing_cache_update.sh /full_listing_cache_update.sh
COPY github_auth_cache_cleaner.sh /github_auth_cache_cleaner.sh
COPY start.sh /start.sh
COPY start.sh stop.sh /

# Install HTML browse includes
COPY include/browse_header.html /etc/nginx/browse_header.html
Expand Down
16 changes: 14 additions & 2 deletions charts/artifacts/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "fullname" $ }}
Expand All @@ -13,4 +13,16 @@ spec:
name: {{ template "fullname" $ }}
minReplicas: {{ .Values.deployment.minReplicas }}
maxReplicas: {{ .Values.deployment.maxReplicas }}
{{ toYaml .Values.deployment.autoscalerSpec | indent 2 }}
metrics:
- type: Resource
resource:
name: memory
target:
type: AverageValue
averageValue: {{ .Values.deployment.autoscalerSpec.memoryUtilization }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.deployment.autoscalerSpec.cpuUtilization }}
9 changes: 8 additions & 1 deletion charts/artifacts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "fullname" $ }}
Expand All @@ -19,6 +18,10 @@ spec:
app: {{ template "fullname" $ }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds }}
{{- if .Values.image.pullSecrets }}
Expand Down Expand Up @@ -53,6 +56,10 @@ spec:
path: /_healthz
port: http
{{ toYaml .Values.deployment.artifacts.livenessProbe | indent 10 }}
lifecycle:
preStop:
exec:
command: ["/stop.sh"]
volumes:
- name: cache
emptyDir: {}
Expand Down
5 changes: 4 additions & 1 deletion charts/artifacts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ nameOverride: "artifacts"
## fullnameOverride allows to change the full name of resources
fullnameOverride:

podAnnotations: {}

githubApiBasicAuth:
## githubApiUrl contains the api url to check the auth connection
##
Expand Down Expand Up @@ -84,7 +86,8 @@ deployment:
## of criterias to meet to scale up and down.
##
autoscalerSpec:
targetCPUUtilizationPercentage: 90
cpuUtilization: 50
memoryUtilization: 500Mi

artifacts:
## Configure resource requests and limits
Expand Down
14 changes: 14 additions & 0 deletions stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

echo "Stopping nginx..."
# Wait a bit before signaling the process to stop
sleep 5
PID=$(cat /run/nginx.pid)
nginx -s quit

echo "Waiting for nginx PID: ${PID} to stop..."
while [ -d /proc/$PID ]; do
sleep 0.1
done
5 changes: 2 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pytest==7.4.2
boto3==1.28.53
pytest==7.4.4
boto3==1.28.68
requests==2.31.0
buildbot-worker==3.9.2

0 comments on commit 960c711

Please sign in to comment.