-
Notifications
You must be signed in to change notification settings - Fork 93
Container support for AWS #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b81d30e
1aaf601
8b0881a
014c786
1bfc272
abf2724
ab23f73
dbada8f
bdca27e
3b248c6
b486fcb
e8e5c58
5565b8e
33f72b8
4f61e00
1f65c2a
5a59ff4
2955bd8
3950429
29fae4e
2577aa6
b7015ad
ac76bb9
0679485
a7bc3e5
8fd1208
3d7bef5
15ed07a
f3dbd91
eb78d67
9c6b693
1a33221
8c95a1d
621c6a2
dfbaee6
a31cbee
33eed6a
7fe3d14
2b4eb74
868bac3
226fe70
7dd8bf5
918cb61
e3ac905
15ece51
9df1aa0
ef496e5
34a46b6
5ffe7e2
b9f5253
6cbcff7
f3175ff
5b3717a
f7961bd
8175ab3
8f39932
37f167f
32b4646
e4a5b26
8a91679
03561be
bee420a
00c5d59
ce64f7d
279c66f
8e3d1f6
00765dd
5d1bc6a
eeb365f
2df6828
df08ad3
18cc75b
7da8d56
ff6359a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from distutils.core import setup | ||
| from glob import glob | ||
| from pkg_resources import parse_requirements | ||
|
|
||
| with open('requirements.txt') as f: | ||
| requirements = [str(r) for r in parse_requirements(f)] | ||
|
|
||
| setup( | ||
| name='function', | ||
| install_requires=requirements, | ||
| packages=['function'], | ||
| package_dir={'function': '.'}, | ||
| package_data={'function': glob('**', recursive=True)}, | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ARG BASE_IMAGE | ||
| FROM $BASE_IMAGE | ||
| COPY . function/ | ||
| COPY handler.js . | ||
mcopik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| RUN cd function \ | ||
| && npm install --no-package-lock --production \ | ||
| && npm cache clean --force | ||
|
|
||
| CMD ["handler.handler"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ARG BASE_IMAGE | ||
| FROM $BASE_IMAGE | ||
| ARG VERSION | ||
| ENV PYTHON_VERSION=${VERSION} | ||
|
|
||
| COPY . function/ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Optimize COPY command to reduce image size The current COPY command includes all files from the build context. Consider using .dockerignore or being more specific about what files to copy to:
-COPY . function/
+COPY requirements.txt function/
+COPY requirements.txt.* function/ 2>/dev/null || true
+COPY handler.py function/
+COPY __init__.py function/ 2>/dev/null || true
|
||
|
|
||
| RUN touch function/__init__.py | ||
| RUN if test -f "function/requirements.txt.${PYTHON_VERSION}"; then \ | ||
| pip install --no-cache-dir \ | ||
| -r function/requirements.txt \ | ||
| -r function/requirements.txt.${PYTHON_VERSION} \ | ||
| function/ && \ | ||
| pip cache purge; \ | ||
| else \ | ||
| pip install --no-cache-dir \ | ||
| -r function/requirements.txt \ | ||
| function/ && \ | ||
| pip cache purge; \ | ||
| fi | ||
|
|
||
| CMD ["function/handler.handler"] | ||
mcopik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,7 @@ For each command you can pass `--verbose` flag to increase the verbosity of the | |
| By default, all scripts will create a cache in the directory `cache` to store code with | ||
| dependencies and information on allocated cloud resources. | ||
| Benchmarks will be rebuilt after a change in source code is detected. | ||
| To enforce redeployment of code and benchmark inputs please use flags `--update-code` | ||
| and `--update-storage`, respectively. | ||
| To enforce redeployment of code, benchmark inputs, container deployment (supported in AWS) please use flags `--update-code`, `--update-storage` and `--container-deployment` respectively. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Documentation needs expansion for container deployment features. Based on the PR objectives, please expand the documentation to include:
Consider adding a new section specifically for container deployment, similar to the existing "Local" section. Would you like me to provide a template for the additional documentation? |
||
|
|
||
| **Note:** The cache does not support updating the cloud region. If you want to deploy benchmarks | ||
| to a new cloud region, then use a new cache directory. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,5 @@ scipy | |
| # | ||
| pycurl>=7.43 | ||
| click>=7.1.2 | ||
| rich | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.