Skip to content

Commit 61487db

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into main
2 parents b1da748 + dc91dff commit 61487db

File tree

24 files changed

+566
-114
lines changed

24 files changed

+566
-114
lines changed

assets/contributors.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ Gayathri Narayana Yegna Narayanan,Arm,,,,
3939
Alexandros Lamprineas,Arm,,,,
4040
Annie Tallund,Arm,annietllnd,annietallund,,
4141
Cyril Rohr,RunsOn,crohr,cyrilrohr,,
42-
Rin Dobrescu,Arm,,,,
42+
Rin Dobrescu,Arm,,,,
43+
Przemyslaw Wirkus,Arm,PrzemekWirkus,przemyslaw-wirkus-78b73352,,
-3.92 KB
Binary file not shown.
-62.3 KB
Loading
-63.9 KB
Loading
3.78 KB
Loading

content/install-guides/aws-copilot.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,60 @@ To install Copilot on macOS:
7373
curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-darwin && chmod +x copilot && sudo mv copilot /usr/local/bin/copilot && copilot --help
7474
```
7575

76+
The help message is printed:
77+
78+
```output
79+
👩‍✈️ Launch and manage containerized applications on AWS.
80+
81+
Commands
82+
Getting Started 🌱
83+
init Create a new ECS or App Runner application.
84+
docs Open the copilot docs.
85+
86+
Develop ✨
87+
app Commands for applications.
88+
Applications are a collection of services and environments.
89+
env Commands for environments.
90+
Environments are deployment stages shared between services.
91+
svc Commands for services.
92+
Services are long-running ECS or App Runner services.
93+
job Commands for jobs.
94+
Jobs are tasks that are triggered by events.
95+
task Commands for tasks.
96+
One-off Amazon ECS tasks that terminate once their work is done.
97+
run Run the workload locally.
98+
99+
Release 🚀
100+
pipeline Commands for pipelines.
101+
Continuous delivery pipelines to release services.
102+
deploy Deploy one or more Copilot jobs or services.
103+
104+
Extend 🧸
105+
storage Commands for working with storage and databases.
106+
secret Commands for secrets.
107+
Secrets are sensitive information that you need in your application.
108+
109+
Settings ⚙️
110+
version Print the version number.
111+
completion Output shell completion code.
112+
113+
Flags
114+
-h, --help help for copilot
115+
-v, --version version for copilot
116+
117+
Examples
118+
Displays the help menu for the "init" command.
119+
`$ copilot init --help`
120+
```
121+
76122
Verify Copilot CLI is installed by running:
77123

78124
```console
79125
copilot --version
80126
```
81-
The version should be printed:
127+
128+
The installed version is displayed:
82129

83130
```output
84-
copilot version: v1.33.0
131+
copilot version: v1.34.0
85132
```
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: AWS SAM CLI
3+
4+
author_primary: Jason Andrews
5+
minutes_to_complete: 15
6+
7+
official_docs: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html
8+
9+
additional_search_terms:
10+
- AWS
11+
- Lambda
12+
13+
layout: installtoolsall
14+
multi_install: false
15+
multitool_install_part: false
16+
test_maintenance: false
17+
tool_install: true
18+
weight: 1
19+
---
20+
21+
The Amazon Web Services (AWS) Serverless Application Model (SAM) CLI is an open-source command-line tool that you can use to build, test, and deploy serverless applications. The SAM CLI provides a Lambda-like execution environment that lets you locally build, test and debug applications defined by AWS SAM templates. It is available for a variety of operating systems and Linux distributions, and supports the Arm architecture.
22+
23+
## Before you begin
24+
25+
Follow the instructions below to install and try the latest version of the AWS SAM CLI for Ubuntu on Arm.
26+
27+
Confirm you are using an Arm machine by running:
28+
29+
```bash { target="ubuntu:latest" }
30+
uname -m
31+
```
32+
33+
The output should be:
34+
35+
```output
36+
aarch64
37+
```
38+
39+
If you see a different result, you are not using an Arm-based computer running 64-bit Linux.
40+
41+
Running the AWS SAM CLI requires Docker. Refer to the [Docker](/install-guides/docker/) Install Guide for installation instructions. Confirm Docker is running before installing the SAM CLI.
42+
43+
Python and Python pip are also required to run the SAM CLI example.
44+
45+
To install, run the following command:
46+
47+
```console
48+
sudo apt install python-is-python3 python3-pip -y
49+
```
50+
51+
## Download and install the AWS SAM CLI
52+
53+
There are two options to install the SAM CLI, you can select your preferred method:
54+
55+
* From a zip file.
56+
* Using the Python `pip` command.
57+
58+
### Download and install from zip file
59+
60+
Use `wget`:
61+
62+
```bash
63+
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-arm64.zip
64+
unzip aws-sam-cli-linux-arm64.zip -d sam-install
65+
sudo ./sam-install/install
66+
```
67+
68+
### Install the SAM CLI using Python pip
69+
70+
```
71+
sudo apt install python3-venv -y
72+
python -m venv .venv
73+
source .venv/bin/activate
74+
pip install aws-sam-cli
75+
```
76+
77+
### Confirm that the SAM CLI has been installed
78+
79+
```bash
80+
sam --version
81+
```
82+
83+
The version should be printed on screen:
84+
85+
```output
86+
SAM CLI, version 1.125.0
87+
```
88+
89+
## Example application
90+
91+
You can use the AWS SAM CLI to build and deploy a simple "Hello World" serverless application that includes the line `uname -m` to check the platform it is running on, by following these steps.
92+
93+
1. Create the project
94+
95+
Use the code below, adjusting the runtime argument if you have a different version of Python:
96+
97+
```console
98+
sam init --runtime python3.12 --architecture arm64 --dependency-manager pip --app-template hello-world --name uname-app --no-interactive
99+
```
100+
101+
2. Change to the new directory:
102+
103+
```console
104+
cd uname-app
105+
```
106+
107+
3. Modify the `hello_world/app.py` file to include the command `uname -m`
108+
109+
Use a text editor to replace the contents of the `hello_world/app.py` file with the code below:
110+
111+
```python
112+
import json
113+
import os
114+
115+
def lambda_handler(event, context):
116+
"""Sample pure Lambda function
117+
118+
Parameters
119+
----------
120+
event: dict, required
121+
API Gateway Lambda Proxy Input Format
122+
123+
Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format
124+
125+
context: object, required
126+
Lambda Context runtime methods and attributes
127+
128+
Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
129+
130+
Returns
131+
------
132+
API Gateway Lambda Proxy Output Format: dict
133+
134+
Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html
135+
"""
136+
137+
ret = os.popen('uname -m').read()
138+
139+
return {
140+
"statusCode": 200,
141+
"body": json.dumps({
142+
"message": ret,
143+
# "location": ip.text.replace("\n", "")
144+
}),
145+
}
146+
```
147+
148+
4. Build the application:
149+
150+
```console
151+
sam build
152+
```
153+
154+
5. Test the deployed application:
155+
156+
```console
157+
sam local invoke "HelloWorldFunction" -e events/event.json
158+
```
159+
160+
The output below shows the results from the command `uname -m` and the value of `aarch64` confirms an Arm Linux computer:
161+
162+
```output
163+
Invoking app.lambda_handler (python3.12)
164+
Local image was not found.
165+
Removing rapid images for repo public.ecr.aws/sam/emulation-python3.12
166+
Building image........................................................................................................................
167+
Using local image: public.ecr.aws/lambda/python:3.12-rapid-arm64.
168+
169+
Mounting /home/ubuntu/uname-app/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated, inside runtime container
170+
START RequestId: 7221da4d-346d-4e2e-831e-dcde1cb47b5b Version: $LATEST
171+
END RequestId: 513dbd6f-7fc0-4212-ae13-a9a4ce2f21f4
172+
REPORT RequestId: 513dbd6f-7fc0-4212-ae13-a9a4ce2f21f4 Init Duration: 0.26 ms Duration: 84.22 ms Billed Duration: 85 ms Memory Size: 128 MB Max Memory Used: 128 MB
173+
{"statusCode": 200, "body": "{\"message\": \"aarch64\\n\"}"}
174+
```
175+
176+
You are ready to use the AWS SAM CLI to build more complex functions and deploy them into AWS. Make sure to select `arm64` as the architecture for your Lambda functions.
177+

content/install-guides/hyper-v.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ A dialog should appear:
7878

7979
## How do I enable Hyper-V from the command line?
8080

81-
1. Open a Command Prompt or Windows PowerShell
81+
1. Open a Command Prompt or Windows PowerShell (as Administrator)
8282

8383
2. Run the `DISM` command below to enable Hyper-V:
8484

content/install-guides/py-woa.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti
2727
layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles
2828
---
2929

30-
Python has native support for [Windows on Arm](https://learn.microsoft.com/en-us/windows/arm/overview). Starting with version 3.11, an official installer is available. The latest version at time of writing is 3.12.0.
30+
Python has native support for [Windows on Arm](https://learn.microsoft.com/en-us/windows/arm/overview). Starting with version 3.11, an official installer is available. The latest version at time of writing is 3.13.0.
3131

3232
A number of developer ready Windows on Arm [devices](/learning-paths/laptops-and-desktops/intro/find-hardware/) are available.
3333

3434
Windows on Arm instances are available with Microsoft Azure. For more information, see [Deploy a Windows on Arm virtual machine on Microsoft Azure](/learning-paths/cross-platform/woa_azure/).
3535

36-
## Download and install
36+
## How do I download and install Python for Windows on Arm?
3737

3838
The installer can be downloaded from the [Python website](https://www.python.org/downloads/windows/). Locate the `ARM64` installer.
3939

4040
You can also download from a PowerShell terminal.
4141
```command
42-
curl https://www.python.org/ftp/python/3.12.0/python-3.12.0-arm64.exe -O python-3.12.0-arm64.exe
42+
curl https://www.python.org/ftp/python/3.13.0/python-3.13.0-arm64.exe --output python-3.13.0-arm64.exe
4343
```
4444

4545
Once downloaded, run the installer `exe` file on a Windows on Arm machine.
@@ -54,44 +54,52 @@ Check `Add python.exe to PATH` if you want to easily invoke python from any dire
5454

5555
![Complete #center](/install-guides/_images/py2-woa.png)
5656

57-
## Invoke python
57+
## How do I start Python on Windows?
5858

5959
At a Windows Command prompt or a PowerShell prompt use `python` or `py` to start the interpreter.
60+
6061
```cmd
6162
py
6263
```
64+
65+
The interpreter starts with output similar to:
66+
6367
```output
64-
Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:15:47) [MSC v.1935 64 bit (ARM64)] on win32
68+
Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 10:17:29) [MSC v.1941 64 bit (ARM64)] on win32
6569
Type "help", "copyright", "credits" or "license" for more information.
6670
>>>
6771
```
68-
Enter `exit()` to leave interpreter.
72+
73+
Enter `exit()` to leave the interpreter:
74+
6975
```python
7076
exit()
7177
```
7278

73-
## Test an example
79+
## How can I run a Python example?
7480

75-
To confirm python is working, save the code below into a file `uname.py`.
81+
To confirm python is working, use a text editor to save the code below to a file named `uname.py`.
7682

77-
#### uname.py
7883
```python
7984
import platform
8085
print("Python version", platform.python_version())
8186
print("Machine is", platform.uname().system, platform.uname().release, platform.uname().machine)
8287
```
8388

84-
Run the code.
89+
Run the code:
90+
8591
```console
8692
py uname.py
8793
```
94+
8895
Running on a Windows on Arm machine produces the output similar to:
96+
8997
```output
90-
Python version 3.12.0
98+
Python version 3.13.0
9199
Machine is Windows 11 ARM64
92100
```
93101

94-
## Installing packages
102+
## How do I install Python packages?
95103

96104
Python `pip` can be used to install packages.
97105

@@ -100,9 +108,8 @@ For example, to install [Flask](https://palletsprojects.com/p/flask/):
100108
pip install Flask
101109
```
102110

103-
Save the code below as `hello.py`:
111+
Use a text editor to save the code below as `hello.py`:
104112

105-
#### hello.py
106113
```python
107114
import platform
108115
from flask import Flask
@@ -131,28 +138,28 @@ WARNING: This is a development server. Do not use it in a production deployment.
131138
* Running on http://10.8.0.10:5000
132139
Press CTRL+C to quit
133140
```
134-
Open a browser to the URL printed by the application. In this example:
141+
Open a browser with the URL printed by the application. In this example:
135142
```url
136143
http://127.0.0.1:5000
137144
```
138145
The output is displayed in the browser window.
139146

140147
![Complete #center](/install-guides/_images/flask-woa.png)
141148

142-
The accesses are reported in the command prompt:
149+
The accesses are reported in the command window:
150+
143151
```output
144152
127.0.0.1 - - [<timestamp>] "GET / HTTP/1.1" 200 -
145153
127.0.0.1 - - [<timestamp>] "GET /favicon.ico HTTP/1.1" 404 -
146154
10.8.0.10 - - [<timestamp>] "GET / HTTP/1.1" 200 -
147155
10.8.0.10 - - [<timestamp>] "GET /favicon.ico HTTP/1.1" 404 -
148156
```
149-
Use `Ctrl+C` to kill the application.
150157

151-
## Using IDLE
158+
Use `Ctrl+C` to stop the application.
152159

153-
Python `IDLE` is included in the installation. IDLE is a simple IDE for python development. You can locate it in your start menu.
160+
## Is Python IDLE available?
154161

155-
![IDLE #center](/install-guides/_images/idle.png)
162+
Python `IDLE` is included in the installation. IDLE is a simple IDE for python development. You can locate it in your start menu.
156163

157164
You can create and run Python applications in this environment.
158165

@@ -163,5 +170,4 @@ Then select `Run` > `Run module` (`F5`) to execute.
163170
![IDLE uname #center](/install-guides/_images/py3-woa.png)
164171

165172

166-
167173
You are now ready to use Python on your Windows on Arm device.

0 commit comments

Comments
 (0)