Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 0a043f8

Browse files
authored
Merge pull request #6 from CSCfi/devel
bump version to 0.1.2
2 parents 70c3251 + 752457f commit 0a043f8

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

Diff for: .github/workflows/publish.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
2020
- name: Build the tagged Docker image
2121
if: ${{ steps.vars.outputs.tag != '/master' && steps.vars.outputs.tag != '/devel' }}
22-
run: docker build . --file Dockerfile --tag cscfi/swift-upload-runner:${{steps.vars.outputs.tag}}
22+
run: docker build . --file Dockerfile --tag cscfi/swiftui-upload-runner:${{steps.vars.outputs.tag}}
2323
- name: Push the tagged Docker image
2424
if: ${{ steps.vars.outputs.tag != '/master' && steps.vars.outputs.tag != '/devel' }}
25-
run: docker push cscfi/swift-upload-runner:${{steps.vars.outputs.tag}}
25+
run: docker push cscfi/swiftui-upload-runner:${{steps.vars.outputs.tag}}
2626
- name: Build the latest Docker image
2727
if: ${{ steps.vars.outputs.tag == '/master' }}
28-
run: docker build . --file Dockerfile --tag cscfi/swift-upload-runner:latest
28+
run: docker build . --file Dockerfile --tag cscfi/swiftui-upload-runner:latest
2929
- name: Push the latest Docker image
3030
if: ${{ steps.vars.outputs.tag == '/master' }}
31-
run: docker push cscfi/swift-upload-runner:latest
31+
run: docker push cscfi/swiftui-upload-runner:latest
3232
- name: Build the stage Docker image
3333
if: ${{ steps.vars.outputs.tag == '/devel' }}
34-
run: docker build . --file Dockerfile --tag cscfi/swift-upload-runner:stage
34+
run: docker build . --file Dockerfile --tag cscfi/swiftui-upload-runner:stage
3535
- name: Push the stage Docker image
3636
if: ${{ steps.vars.outputs.tag == '/devel' }}
37-
run: docker push cscfi/swift-upload-runner:stage
37+
run: docker push cscfi/swiftui-upload-runner:stage

Diff for: Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-alpine3.9 as BACKEND
1+
FROM python:3.7-alpine3.12 as BACKEND
22

33
RUN apk add --update \
44
&& apk add --no-cache build-base curl-dev linux-headers bash git\
@@ -13,15 +13,15 @@ RUN pip install --upgrade pip\
1313
&& pip install -r /root/swift_upload_runner/requirements.txt \
1414
&& pip install /root/swift_upload_runner
1515

16-
FROM python:3.7-alpine3.9
16+
FROM python:3.7-alpine3.12
1717

1818
RUN apk add --no-cache --update bash
1919

2020
LABEL maintainer "CSC Developers"
2121
LABEL org.label-schema.schema-version="1.0"
2222
LABEL org.label-schema.vcs-url="https://github.com/CSCFI/swift-upload-runner"
2323

24-
COPY --from=BACKEND usr/local/lib/python3.7 usr/local/lib/python3.7/
24+
COPY --from=BACKEND /usr/local/lib/python3.7 /usr/local/lib/python3.7/
2525

2626
COPY --from=BACKEND /usr/local/bin/gunicorn /usr/local/bin/
2727

Diff for: swift_upload_runner/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Runner for swift-browser-ui upload and replication operations."""
22

33
__name__ = 'swift_upload_runner'
4-
__version__ = '0.1.1'
4+
__version__ = '0.1.2'
55
__author__ = 'CSC Developers'
66
__license__ = 'MIT License'

Diff for: swift_upload_runner/api.py

+12
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,15 @@ async def handle_get_container(
195195
await download.a_write_to_response(resp)
196196

197197
return resp
198+
199+
200+
async def handle_health_check(
201+
request: aiohttp.web.Request
202+
) -> aiohttp.web.Response:
203+
"""Answer a service health check."""
204+
# Case degraded
205+
206+
# Case nominal
207+
return aiohttp.web.json_response({
208+
"status": "Ok",
209+
})

Diff for: swift_upload_runner/server.py

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .auth import handle_login, read_in_keys, handle_validate_authentication
1717
from .api import handle_get_object, handle_get_container
1818
from .api import handle_post_object_chunk, handle_post_object_options
19+
from .api import handle_health_check
1920

2021

2122
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
@@ -48,6 +49,10 @@ async def servinit() -> aiohttp.web.Application:
4849
aiohttp.web.post("/{project}", handle_login)
4950
])
5051

52+
app.add_routes([
53+
aiohttp.web.get("/health", handle_health_check)
54+
])
55+
5156
# Add api routes
5257
app.add_routes([
5358
aiohttp.web.get("/{project}/{container}/{object_name:.*}",

0 commit comments

Comments
 (0)