* adding a sample project with plural form of TargetFrameworks for debugging purpose
* add --framework argument to RunCommand
* Pass down "framework" as a BuildProperty if not already defined in the YAML
* Do no throw anymore when multiple TargetFrameworks are found, if one was specified as a BuildProperty
* replicating Signature change on code base (that does not look like a good idea)
* adding comment to be explicit on what this does
* Check that the specified BuildProperties["TargetFramework"] is on of the TargetFrameworks
* add launchSettings for debug
* Create a BuildCommandArguments for the BuildCommand / add a "framework" options to it and move some logic to the CommandHandler (just like the RunCommand)
* add "-f {framework}" to dotnet publish if a TargetFramework BuildProperties exists
* Create a GenerateCommandArguments for the GenerateCommand / add a "framework" options to it and move some logic to the CommandHandler
* Create a PushCommandArguments for the PushCommand / add a "framework" options to it and move some logic to the CommandHandler
* Create a UndeployCommandArguments for the UndeployCommand / add a "framework" options to it and move some logic to the CommandHandler
* Create a DeployCommandArguments for the DeployCommand / add a "framework" options to it and move some logic to the CommandHandler
* framework is now an optional parameter defaulted to null
Co-authored-by: Justin Kotalik <jukotali@microsoft.com>
* Change sample to use LTS only
* Make "framework" argument nullable / optional / defaulted to null
* remove "Force" from "PushCommand" and "PushCommandArguments" if it's not used
* re-use the equivalent message than "dotnet run" on a project with multiple TargetFrameworks
* Create a StandardOptions for Framework
* Remove unused StandardOption.Force and add StandardOption.CreateForce with customizable "description"
* Use StandardOptions.Framework in various commands
* use StandardOptions.Force ni various commands
* Create a new InitCommandArguments and re-use the same OutputContext like the other Commands
* prefer type alias (String.IsNullOrEmpty => string.IsNullOrEmpty), not sure if it was intended
* Adding assets for E2E about multi-targetframeworks that returns the current TargetFramework on every HttpRequest
* Adding test for "tye run" with either buildProperties in the yaml or framework passed directly to ApplicationFactory.CreateAsync
* Add test and testasset project for both TargetFrameworks and TargetFramework
* Always overwrite the TargetFramework if one is specified from the CLI (like dotnet CLi) even if it means it wont build / run etc ....
* Test the ability to override TargetFramework from CLI even if define in csproj or in yaml
* Consistency over ApplicationFactory.CreateAsync in all E2E tests
* rename testasset project to multi-targetframeworks to match generated Dockerfile
* Add E2E for tye build when project uses multi-targetframeworks
* Adding test directly for ApplicationFactory to check that it overrides YAML existing buildProperties
* Adding test to make sure it still throw if there's no explicit TargetFramework or that it is one of the predefined one
* Adding test for ApplicationFactory.CreateAsync with a framework if nothing is set in yaml
* make cli arguments class private
* review: remove extra line
* review: remove 'framework' notion from Undeploy
* Fix project evaluation of multi-targetd projects
* Fixup a few more tests
* Comment updates
* Ensure TFM is only applied for multi-targeting projects
Co-authored-by: Justin Kotalik <jukotali@microsoft.com>
Co-authored-by: John Luo <johluo@microsoft.com>
* changing sample project to use microsoft health checks library
* update probes recipe
* Update probes.md
* changing probes doc
* give more description in '/' of sample service
* sample app and beggining of recipe
* fix link
* sample, recipe and schema docs
* change http failures to debug logs
* add model validation to probes and http prober
* add deserialization and validation tests
* license
* format
* PR fixes
* remove some Console.WriteLine's
Fixes#296
Adds conditional logic for passing these properties to `daprd`.
Corrects logic for dealing with config. Dapr's config annotation in k8s
refers to kubernetes resource by name, but that's not possible with
local run. In local run `dapr` will expect the `-config` parameter to be
a file on disk. So, this change adds logic to look for a file by naming
convention and pass that locally instead.
Additionally added the ability for an extension to output to the console
- this is needed because we want to tell the user if their config file
can't be found, and specifically where we looked. I made the decision to
log a message and skip if the config file isn't present, because we
don't have a way to make settings conditional based on environment yet -
it makes sense that someone might need to have a config in production
but not in local dev.
* Use environment variables for secrets
- Updating in place does not apply to connection strings specifically since they are usually configured at startup as singletons.
- This brings consistency with the development experience.
- Gets rid of AddTyeBindings
- "Less secure", sure but to be pedantic env variables are stored in virtual file on disk while the process is running. I'd argue if you want full security then use keyvault/vault/name your secret store.
Fixes#313
* Removed the last AddTyeSecrets call
Implements two flavor of library support for service-discovery:
- GetConnectionString (arbitrary strings) augmenting existing
functionality already in asp.net core
- GetServiceUri (uris) can be combined
from a protocol/host/port triple
See the **extensive** doc `service_discovery.md` that is filled out in this PR. That documents pretty much everything about how this works now.
* Added container proxy for talking to the host
- This change introduces a container proxy which makes it possible for docker containers can talk to host services using container networking. These proxies will not show up in the dashboard as they are "infrastructure" containers.
- Added Private and NetworkAlias to DockerRunInfo but did not expose these configuration.
- All container communication is done using host names.
- Fix host shutdown again
- Bind to all interfaces on linux
* Add test for container -> host communication.
* Small tweaks
- Modify frontend-backend app to print backend url
- Fix log in docker runner
- Rename test to use docker instead of container
* More clean up
- Don't set container port if the service isn't a container
* Bind to all interfaces on linux only
This removes the need to copy-paste code that reads a specific directory
in Program.cs.
Updated docs/samples and tests.
We need a workaround in tests to be able to use a P2P for the library. What
I did here is the same trick we do in Razor.
- Force everyone to use an MSBuild variable to locate the library
- Set that variable in a Directory.Build.props for the normal build
- Drop a special Directory.Build.props for testing
Updates a bunch of test code to use new helper methods for copying
stuff, so we can correctly do this.
- Turns out the same alias works fine and docker will
associate multiple IPs with a single alias
- Remove the docker run command from the output and leave it in the log
- Dump out the backend host names in the frontend backend example
* Add support for container networking
- This adds all containers in the tye.yaml to the same container network.
- Container networking only works with a single replica today since the containers are named after their replicas.
- Use the container host name and port when injecting env variables. This handles the replica case by falling back to the host ip and port.
- This cleans up container to container communication when migrating docker-compose files.
- Don't override assign container port if already set.
- Remove StopAsync from TyeHost and exposed DisposeAsync. This patterns removes common clean up and hanging issues that occur.
- Cleaned up run tests to use similar code to run, clean up and capture logs.
* Move where we handle errors while shutting down the host
* Fixed project -> container networking issue
- Only use service name as the host name if both target and source re containers
* Formatting...
* Add service definition to the logs
* Added env variables to disable console colors for process run
* Hit the backend before the frontend
* Small cleanup
- Update docs to use host name for redis cli
- Show docker network and network alias in the API
It's against the law! using multiple replicas with dapr won't work correctly
with pub-sub until we add first-class sidecar handling to the hosting model.
This makes us fail with a reasonable error message for now.
* Add Dapr integration to Tye
Adds a new `extensions` integration point. Currently all extensbility has
to be inside the Tye codebase. There's no functionality for loading or distributing
plugins.
Enable dapr for an application like:
```yaml
name: test_app
extensions:
- name: dapr
```
The dapr extension currently accepts and requires no additional options, and applies
to all services defined in the application.
What it does:
- In local run: starts a dapr sidecar for each project that does http
- In local run: sidecars start in the directory of tye.yaml, so dapr will look for
component manifests in ./components (relative to tye.yaml
- In deployment: adds required annotations to deployments
Some new features that were added to tye to enable this:
- Config: Ability to parse and conditionally run extensions
- Run: Ability to token replace env-vars into command line args
- Deploy: Ability to configure labels and annotations
* format
* Massage labesl:
* PR feedback
* Fix tests
* Remove reading of launch settings
- If bindings are specified, add an http and https binding with autodetect port to true.
- Prefer HTTP over HTTPS for ingress
* Renamed dockerImage to image
- Added a new image field and marked dockerImage as deprecated. Will remove in a future version.
- Fixes#122
* Removed dockerImage support
* Added dockerImage back to the docs
This tries to add some auto-detect magic to make common scenarios work
without any extra configuration, which avoiding doing obtuse stuff.
- We ignore the ports in launch settings (avoid conflict in the
hello world multi-project case)
- When we infer bindings based on launch settings we set them to
auto-select a port
- The user setting a port via tye.yaml will always win
- Bindings that are not inferred from launch settings still work
the same way (we don't auto-auto-select a port)
- When we deploy we ignore https
The HTTPS behavior might need discussion, but we haven't started looking
at a recipe for HTTPs inside the cluster in k8s, and it's not clear
whether we even want to.
One could also make the argument that we should skip TLS locally because
we're not doing it inside the cluster. Someone writing an app today that
assumes TLS in their code (using https URLs, or gRPC + TLS) will have
a non-trivial path to k8s for now anyway. So, skipping https bindings
for k8s really just makes us more honest.