Skip to content

Commit 85dbee6

Browse files
agoncalsinedied
authored andcommitted
Review DevContainers
1 parent 33fb565 commit 85dbee6

File tree

5 files changed

+48
-7
lines changed

5 files changed

+48
-7
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
},
2828
"ghcr.io/devcontainers/features/github-cli:1": {},
2929
// "ghcr.io/devcontainers/features/powershell:1": {},
30-
"ghcr.io/azure/azure-dev/azd:latest": {}
30+
"ghcr.io/azure/azure-dev/azd:latest": {},
31+
"ghcr.io/prulloac/devcontainer-features/ollama:1": {
32+
"pull": "llama3"
33+
}
3134
},
3235

3336
// Configure tool-specific properties.
@@ -46,7 +49,7 @@
4649
},
4750

4851
// Use 'forwardPorts' to make a list of ports inside the container available locally.
49-
"forwardPorts": [3000, 3001, 8000, 6333],
52+
"forwardPorts": [3000, 3001, 8000, 6333, 11434],
5053

5154
// Use 'postCreateCommand' to run commands after the container is created.
5255
"postCreateCommand": "npm install -g @moaw/cli fuzz-run",

docs/_workshop-java-quarkus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ include::sections/java-quarkus/09-azure.md[]
3838

3939
---
4040

41-
include::sections/10-deployment.md[]
41+
include::sections/java-quarkus/10-deployment.md[]
4242

4343
---
4444

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Deploying to Azure
2+
3+
Our application is now ready to be deployed to Azure! But first of all, make sure you don't deploy the application with the llama3 model. For that, make sure to remove or comment the alternative from the `src/backend/src/main/resources/application.properties` file.
4+
5+
```properties
6+
quarkus.http.port=3000
7+
quarkus.log.level=INFO
8+
quarkus.log.category."ai.azure.openai.rag.workshop.backend".level=DEBUG
9+
#quarkus.arc.selected-alternatives=ai.azure.openai.rag.workshop.backend.configuration.ChatLanguageModelOllamaProducer
10+
```
11+
12+
We'll use [Azure Static Web Apps](https://learn.microsoft.com/azure/static-web-apps/overview) to deploy the frontend, and [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview) to deploy the backend and ingestion services.
13+
14+
Run this command from the root of the project to build and deploy the application (this command deploys all services listed in the `azure.yaml` file located in the project root):
15+
16+
```bash
17+
azd deploy
18+
```
19+
20+
Once everything is deployed, run the ingestion process against your deployed ingestion service, using `./scripts/ingest-data.sh` script on Linux or macOS, or `./scripts/ingest-data.ps1` on Windows:
21+
22+
```bash
23+
./scripts/ingest-data.sh
24+
```
25+
26+
This process should take a few minutes. Once it's done, you should see the URL of the deployed frontend application in the output of the command.
27+
28+
![Output of the azd command](./assets/azd-deploy-output.png)
29+
30+
You can now open this URL in a browser and test the deployed application.
31+
32+
![Screenshot of the deployed application](./assets/deployed-app.png)
33+
34+
<div class="tip" data-title="Tip">
35+
36+
> You can also build and deploy the services separately by running `azd deploy <service_name>`. This allows you to deploy independently the backend, frontend and ingestion services if needed.
37+
>
38+
> Even better! If you're starting from scratch and have a completed code, you can use the `azd up` command. This command combines both `azd provision` and `azd deploy` to provision the Azure resources and deploy the application in one command.
39+
40+
</div>

scripts/repo/create-github-template.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ import jakarta.enterprise.inject.Produces;
270270
import org.eclipse.microprofile.config.inject.ConfigProperty;
271271
272272
import static java.time.Duration.ofSeconds;
273+
import org.slf4j.Logger;
274+
import org.slf4j.LoggerFactory;
273275
274276
public class ChatLanguageModelAzureOpenAiProducer {
275277

src/backend-java-quarkus/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
<type>pom</type>
3838
<scope>import</scope>
3939
</dependency>
40-
<dependency>
41-
<groupId>dev.langchain4j</groupId>
42-
<artifactId>langchain4j-ollama</artifactId>
43-
</dependency>
4440
</dependencies>
4541
</dependencyManagement>
4642
<dependencies>

0 commit comments

Comments
 (0)