This repository was archived by the owner on Mar 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +59
-10
lines changed
Expand file tree Collapse file tree 6 files changed +59
-10
lines changed Original file line number Diff line number Diff line change 1+ """
2+ Copyright 2020 Lightbend Inc.
3+ Licensed under the Apache License, Version 2.0.
4+ """
5+
6+ from .version import __version__
7+
8+ __all__ = [
9+ '__version__' ,
10+ ]
Original file line number Diff line number Diff line change 1-
21# -*- coding: utf-8 -*-
32
43"""
4+ Copyright 2020 Lightbend Inc.
55Licensed under the Apache License, Version 2.0.
66"""
77
8- __version__ = "0.5.0"
8+ __version__ = "0.5.0"
Original file line number Diff line number Diff line change 1+ """
2+ Copyright 2020 Lightbend Inc.
3+ Licensed under the Apache License, Version 2.0.
4+ """
5+
16from setuptools import setup , find_packages
27
38# Load version in cloudstate package.
1419 description = 'Cloudstate Python Support Library' ,
1520 packages = find_packages (exclude = ['tests' , 'shoppingcart' ]),
1621 long_description = open ('README.md' ).read (),
17- zip_safe = False )
22+ zip_safe = False )
Original file line number Diff line number Diff line change 11FROM python:3.8.0-slim
22
3- COPY . /app
4- WORKDIR /app
5- RUN pip install --user -r requirements.txt && \
6- pip install wheel && \
7- python setup.py bdist_wheel && \
8- pip install dist/cloudstate-0.5.0-py3-none-any.whl
3+ COPY ./dist /dist
4+ RUN pip install /dist/cloudstate-0.5.0-py3-none-any.whl
95
10- ENTRYPOINT python shopping_cart.py
6+ WORKDIR /app
7+ COPY ./shoppingcart ./shoppingcart
8+ ENV PYTHONPATH=/app
9+ ENTRYPOINT python ./shoppingcart/shopping_cart.py
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ docker build -t gcr.io/mrcllnz/cloudstate-python-tck -f shoppingcart/Dockerfile .
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -o nounset
3+
4+ function rnd() {
5+ cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w ${1:- 32} | head -n 1
6+ }
7+
8+ FUNC_IMAGE=${1:- gcr.io/ mrcllnz/ cloudstate-python-tck: latest}
9+ FUNC=" cloudstate-function-$( rnd) "
10+ PROXY_IMAGE=${2:- cloudstateio/ cloudstate-proxy-dev-mode: latest}
11+ PROXY=" cloudstate-proxy-$( rnd) "
12+ TCK_IMAGE=${3:- cloudstateio/ cloudstate-tck: latest}
13+ TCK=" cloudstate-tck-$( rnd) "
14+
15+ finally () {
16+ docker rm -f " $PROXY "
17+ docker rm -f " $FUNC "
18+ }
19+ trap finally EXIT
20+ set -x
21+
22+ # run the function and the proxy
23+ docker run -d --name " $FUNC " --net=host " ${FUNC_IMAGE} " || exit $?
24+ docker run -d --name " $PROXY " --net=host -e USER_FUNCTION_PORT=8090 " ${PROXY_IMAGE} " || exit $?
25+
26+ # run the tck
27+ docker run --rm --name " $TCK " --net=host " ${TCK_IMAGE} "
28+ tck_status=$?
29+ if [ " $tck_status " -ne " 0" ]; then
30+ docker logs " $FUNC "
31+ fi
32+ exit $tck_status
You can’t perform that action at this time.
0 commit comments