This repository contains a companion project (used in solution-3 as remote repository) demonstrated on .NET fwdays'21 conference on 2021-08-07.
The repository contains:
- .vscode/launch.json - launch configuration for Docker container debugging (used in demo to debug
companion-containerized-api
service). - companion-containerized-api - a .NET 5 service to generate random weather forecast information.
- companion-source-api - a .NET 5 service which enriches weather forecast obtained from
companion-containerized-api
service source information. - request.http - a list of requests for the application (used in demo).
- tye.yaml - configuration of
tye
tool.
companion-containerized-api
service is built fromcompanion-containerized-api/Dockerfile
.companion-source-api
service is built fromcompanion-source-api/companion-source-api.csproj
.
Please ensure to install:
- REST Client extension for Visual Studio Code.
Developer's comment
This is required to execute requests from
request.http
file.
- Docker extension for Visual Studio Code.
Developer's comment
This is required to debug service containers
- Project Tye is installed and getting started tutorial is finished.
- Take a look at
tye.yaml
.- Pay attention to fixed ports in
bindings
(which are required to simplify demonstration by usingrequests.http
). - Pay attention to
containerPort
configuration.
- Pay attention to fixed ports in
- Take a look at
companion-source-api/Startup.cs
.- Pay attention to usage of Tye extension method for configuration.
- Execute
tye run
command. - Open Project Tye Extension.
- Navigate and demonstrate dashboard
- Pay attention to
Project
vsContainer
. - Pay attention to bindings.
- Pay attention to
- Open to
request.http
.- Execute request to
companion-containerized-api
. - Execute request to
companion-source-api
. - Pay attention to differences.
- Execute request to
- Use Tye extension to attach debugger to
companion-source-api
.- Pay attention that currently there is no built in way to attach debugger to container.
- Verify debugger works (in
WeatherForecastController
). - Use Visual Studio Code "Docker .NET Core Attach (Preview)" debug configuration to debug
companion-containerized-api
service. - Detach debuggers.
- CTRL+C to cancel
tye run
.
- Execute
tye deploy -i
(specify required container registry). - Use
kubectl
to- View services
kubectl get service
- Establish port forwarding for
companion-source-api
kubectl port-forward svc/companion-source-api 8800:8800
- View services
- Open
request.http
and execute request tocompanion-containerized-api
. - Execute
tye undeploy
.
This project is owned by Coherent Solutions.
This project is licensed under the MIT License - see the LICENSE.md for details.