-
Notifications
You must be signed in to change notification settings - Fork 14
86 lines (75 loc) · 3.05 KB
/
lithops-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Lithops images
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.lithops-backend }} ${{ matrix.os }} py${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.11"
requirements-file: ci/requirements-lithops-aws.txt
lithops-config: .github/workflows/.lithops_config_aws
lithops-backend: aws_lambda
lithops-build-file: ci/docker/Dockerfile_aws_lambda_main
lithops-memory: 2000
- os: ubuntu-latest
python-version: "3.11"
requirements-file: ci/requirements-lithops-gcp.txt
lithops-config: .github/workflows/.lithops_config_gcp
lithops-backend: gcp_functions
lithops-build-file: ci/requirements-lithops-gcp.txt
lithops-memory: 2048
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy lithops configuration templates
run: |
cp $GITHUB_WORKSPACE/.github/workflows/.lithops_config_aws.template $GITHUB_WORKSPACE/.github/workflows/.lithops_config_aws
cp $GITHUB_WORKSPACE/.github/workflows/.lithops_config_gcp.template $GITHUB_WORKSPACE/.github/workflows/.lithops_config_gcp
- name: Google auth
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
create_credentials_file: true
- name: Configure lithops AWS
uses: microsoft/variable-substitution@v1
with:
files: ${{ github.workspace }}/.github/workflows/.lithops_config_aws
env:
aws.access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws.secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Configure lithops GCP
uses: microsoft/variable-substitution@v1
with:
files: ${{ github.workspace }}/.github/workflows/.lithops_config_gcp
env:
gcp.credentials_path: ${{ steps.auth.outputs.credentials_file_path }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -r ${{ matrix.requirements-file }}
- name: Build and deploy images
env:
LITHOPS_CONFIG_FILE: ${{ github.workspace }}/${{ matrix.lithops-config }}
run: |
lithops runtime delete -b ${{ matrix.lithops-backend }} -d cubed-runtime-main
lithops runtime build -b ${{ matrix.lithops-backend }} -f ${{ matrix.lithops-build-file }} cubed-runtime-main
lithops runtime deploy -b ${{ matrix.lithops-backend }} --memory ${{ matrix.lithops-memory }} cubed-runtime-main