Skip to content

Commit

Permalink
Sync code with origin (#190)
Browse files Browse the repository at this point in the history
* Sync code with origin

* update
  • Loading branch information
dingmeng-xue authored Jan 18, 2024
1 parent ff456ce commit 2e8e435
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 59 deletions.
3 changes: 2 additions & 1 deletion accelerator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ accelerator:

engine:
merge:
- include: [ "apps/**", "azure-spring-apps-enterprise/media/**", "*.md", "LICENSE", ".gitignore"]
- include: [ "apps/**", "azure-spring-apps-enterprise/**", "*.md", "LICENSE", ".gitignore" ]
exclude: [ "azure-spring-apps-enterprise/media/**" ]
2 changes: 1 addition & 1 deletion apps/acme-assist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.2</version>
<version>3.2.1</version>
</parent>
<groupId>com.azure.acme</groupId>
<artifactId>acme-assist</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion apps/acme-cart/.python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.9
3.11.7
14 changes: 14 additions & 0 deletions apps/acme-cart/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use an official Python runtime as a base image
FROM python:3.11

# Set the working directory in the container
WORKDIR /app

# Copy the entire local directory into the container at /app
COPY . /app

# Install dependencies
RUN pip install -r requirements.txt

# Specify the command to run your application
CMD ["python", "cart.py"]
27 changes: 19 additions & 8 deletions apps/acme-cart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ There are different dependencies based on whether you want to run a built contai

### Source

A pyenv `.python-version` configuration file is provided. You can
configure a compatible environment using `pyenv` by running `pyenv install`.
A pyenv `.python-version` configuration file is provided.

You can configure a compatible environment using `pyenv` by running `pyenv install`.

To build the app as a stand-alone executable, run `pip install -r requirements.txt` to install the Python libraries and run `python3 cart.py` after.

Expand All @@ -39,14 +40,20 @@ The **cart** service, either running inside a Docker container or as a stand-alo
* **REDIS_PASSWORD**: The password to connect to Redis (defaults to `blank`)
* **CART_PORT**: The port number the cart service will listen to requests (defaults to `5000`)

The Docker image is based on the Bitnami Python container. Use this commands to run the latest stable version of the payment service with all available parameters:
The docker image of acme-cart can be built using the provided Dockerfile and the following command:

```bash
# Run the Redis container
docker run -p 6379:6379 bitnami/redis:latest
# Build the acme-cart image
docker build -t acme-cart .
```

The acme-cart image is based on the official Python image.

To run the acme-cart and the redis dependency for local test, use the `docker-compose` file:

# Run the cart service
docker run --rm -it -e REDIS_HOST=localhost -e REDIS_PORT=6379 -e REDIS_PASSWORD=myAwesomePassword -e CART_PORT=5000 -p 5000:5000 gcr.io/vmwarecloudadvocacy/acmeshop-cart:stable
```bash
# Run the Redis container
docker-compose up
```

## API
Expand Down Expand Up @@ -272,4 +279,8 @@ curl --request GET \

[Pull requests](https://github.com/Azure-Samples/acme-fitness-store/pulls) are welcome. For major changes, please open [an issue](https://github.com/Azure-Samples/acme-fitness-store/issues) first to discuss what you would like to change.

Please make sure to update tests as appropriate.
Please make sure to update tests as appropriate.

## License

See the [LICENSE](../../LICENSE) file in the repository
48 changes: 27 additions & 21 deletions apps/acme-cart/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
version: '2'

services:
cart:
image: acmeshop-cart:latest
hostname: cart
restart: always
ports:
- '5000:5000'
cap_drop:
- all
cap_add:
- NET_BIND_SERVICE
read_only: true
reddb:
image: redis:5.0.3-alpine
hostname: reddb
restart: always
cap_drop:
- all
cap_add:
- NET_BIND_SERVICE
ports:
- '6379:6379'
cart:
image: acmeshop-cart:latest
hostname: cart
restart: always
ports:
- '5000:5000'
cap_drop:
- all
cap_add:
- NET_BIND_SERVICE
read_only: true
environment:
- REDIS_HOST=reddb
- REDIS_PORT=6379
- AUTH_MODE=0
reddb:
image: bitnami/redis:latest
hostname: reddb
restart: always
cap_drop:
- all
cap_add:
- NET_BIND_SERVICE
ports:
- '6379:6379'
environment:
- ALLOW_EMPTY_PASSWORD=yes
32 changes: 16 additions & 16 deletions apps/acme-cart/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
blinker==1.4
blinker==1.7.0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
contextlib2==0.5.5
Flask==1.1.1
Flask-HTTPAuth==3.3.0
Click==8.1.3
contextlib2==21.6.0
Flask==2.0.1
Flask-HTTPAuth==4.0.0
future==0.17.1
idna==2.8
itsdangerous==1.1.0
jaeger-client==4.0.0
Jinja2==2.10.3
MarkupSafe==1.1.1
itsdangerous==2.1.2
jaeger-client==4.8.0
Jinja2~=3.0.3
MarkupSafe==2.1.3
opentracing==2.2.0
redis==3.2.1
redislite==6.0.674960
redis==3.4.0
redislite==3.2.311
requests==2.22.0
sentry-sdk==0.13.5
six==1.12.0
six==1.16.0
statsd==3.3.0
threadloop==1.0.2
thrift==0.11.0
tornado==4.5.3
tornado==6.4
urllib3==1.25.7
Werkzeug==0.16.0
Werkzeug~=2.0.1
wrapt==1.11.1
opencensus~=0.8.0
opencensus~=0.11.4
opencensus-ext-azure==1.1.3
opencensus-ext-flask==0.7.6
opencensus-ext-flask==0.8.2
azure-identity==1.9.0
azure-keyvault-secrets==4.4.0
8 changes: 4 additions & 4 deletions apps/acme-catalog/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
springBootVersion=3.0.5
springCloudVersion=2022.0.2
springCloudAzureVersion=5.0.0
testcontainersVersion=1.17.6
springBootVersion=3.2.1
springCloudVersion=2023.0.0
springCloudAzureVersion=5.8.0
testcontainersVersion=1.19.3
1 change: 1 addition & 0 deletions apps/acme-identity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation "org.springframework.security:spring-security-oauth2-resource-server"
implementation "org.springframework.security:spring-security-oauth2-jose"
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

implementation 'com.azure.spring:spring-cloud-azure-starter-keyvault-secrets'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
Expand Down
6 changes: 3 additions & 3 deletions apps/acme-identity/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
springBootVersion=3.0.5
springCloudVersion=2022.0.2
springCloudAzureVersion=5.0.0
springBootVersion=3.2.1
springCloudVersion=2023.0.0
springCloudAzureVersion=5.8.0
2 changes: 1 addition & 1 deletion apps/acme-identity/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spring:
oauth2:
resourceserver:
jwt:
jwk-set-uri: ${JWK_URI}
jwk-set-uri: ${JWK_URI}
6 changes: 6 additions & 0 deletions apps/acme-identity/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring:
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri: "http://example.com"
4 changes: 2 additions & 2 deletions apps/acme-payment/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
springBootVersion=3.0.5
springCloudVersion=2022.0.2
springBootVersion=3.2.1
springCloudVersion=2023.0.0
2 changes: 1 addition & 1 deletion apps/acme-shopping/public/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<!--<button class="btn btn-outline-secondary search mr-1"><span class="sr-only">Toggle search</span><i class="fa fa-search"> </i></button>-->
<a href="cart.html" class="btn btn-outline-primary"><i class="fa fa-shopping-cart"></i><span
id="totalItemsMd" class="hidden-sm">0 items <span class="hidden-md">in cart </span></span></a>
<button type="button" class="btn btn-primary" id="aiChatAskBtn"><i class="fa fa-lightbulb-o"></i>Ask to
<button type="button" class="btn btn-primary" id="aiChatAskBtn"><i class="fa fa-lightbulb-o"></i>Ask
FitAssist</button>
</div>
</div>
Expand Down

0 comments on commit 2e8e435

Please sign in to comment.