Skip to content

Commit 36f7625

Browse files
committed
Merge AWS Lambda installation documentation into official docs
1 parent ee82714 commit 36f7625

2 files changed

Lines changed: 53 additions & 55 deletions

File tree

aws/lambda/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/ifcopenshell-python/docs/ifcopenshell-python/installation.rst

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ There are different methods of installation, depending on your situation.
77
2. **PyPI** is recommended for developers using Pip.
88
3. **Conda** is recommended for developers using Anaconda.
99
4. **Docker** is recommended for developers using Docker.
10-
5. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a graphical interface.
11-
6. **From source with precompiled binaries** is recommended for developers actively working with the Python code.
12-
7. **Compiling from source** is recommended for developers actively working with the C++ core.
10+
5. **AWS Lambda** is recommended for developers using AWS Lambda functions.
11+
6. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a graphical interface.
12+
7. **From source with precompiled binaries** is recommended for developers actively working with the Python code.
13+
8. **Compiling from source** is recommended for developers actively working with the C++ core.
1314

1415
Pre-built packages
1516
------------------
@@ -130,11 +131,56 @@ Docker
130131

131132
Installing IfcOpenShell from Docker will also install IfcConvert.
132133

133-
.. using-container-on-aws-lambda::
134+
AWS Lambda
135+
----------
134136

135-
Refer `AWS Lambda
136-
Readme
137-
<https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/aws/lambda/README.md>`__.
137+
This guide provides a Dockerfile and sample code to help you run an AWS Lambda
138+
function written in Python and using the IfcOpenShell library.
139+
140+
This is only a superficial guide, in order to make this work for your usecase
141+
you will need a good understanding of other AWS services like SQS, S3, API
142+
Gateways, etc.
143+
144+
.. seealso::
145+
146+
For more information on building lambda containers refer to the `AWS guide
147+
on working with Lambda container images
148+
<https://docs.aws.amazon.com/lambda/latest/dg/images-create.html>`__
149+
150+
1. Clone or download the `IfcOpenShell repository
151+
<https://github.com/ifcopenshell/ifcopenshell>`_.
152+
153+
2. Replace the sample Lambda function code in the `example_handler
154+
<https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/aws/lambda/example_handler/__init__.py>`__
155+
directory with your own code.
156+
157+
3. Update the import path in the Dockerfile's `CMD instruction
158+
<https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/aws/lambda/Dockerfile#L40>`__
159+
to match your Lambda function's handler function.
160+
161+
4. Edit the `requirements.txt
162+
<https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/aws/lambda/requirements.txt>`__
163+
file and add any additional dependencies required by your Lambda function.
164+
165+
5. Build the Docker image:
166+
167+
.. code-block::
168+
169+
$ docker build -t lambda-ifcopenshell .
170+
171+
6. Run the Docker container:
172+
173+
.. code-block::
174+
175+
$ docker run lambda-ifcopenshell
176+
177+
7. Test lambda locally by following the `AWS guide on testing Lambda container
178+
images locally
179+
<https://docs.aws.amazon.com/lambda/latest/dg/images-test.html>`__.
180+
181+
8. Deploy to lambda. This is beyond the scope of this guide. Please refer to
182+
the AWS documentation. Some tools that could be useful are AWS
183+
CloudFormaton, AWS CDK, pulumi or terraform.
138184

139185
Using the BlenderBIM Add-on
140186
---------------------------

0 commit comments

Comments
 (0)