fix: unjank the demo #85
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: NationTech/harmony#85
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix_demo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix: unjank the demoto WIP: fix: unjank the demoOverall improvement, going in the right direction.
I'm not convinced about bollard as it adds another layer of abstraction, dependency and potential bugs for what seems to me little improvement in readability and capability. But I see some interesting things so it's fine for now.
Make sure to respect the mindset of a Harmony application to provide opinionated infrastructure features for modern applications as easily as possible for a developer that doesn't want anything to do with it.
What is important to them is to receive alerts when they have something going wrong. We must be able to use whatever alerting stack implementation under the hood as we want.
The way it is written in this p-r, we're stuck forever with ntfy and prometheus (or at least, this application is).
Always keep in mind that this application definition must work today, but also next year and 5 years from now when we have moved away from all these tools to adopt the new generation of alerting or whatever, without any change.
The idea is that the Application score is a "write once, run forever" thing.
@ -2,3 +2,7 @@ target
private_repos
log/
*.tgz
examples/rust/examples/rust/webapp/helm/
These would be better in the examples's own gitignore file
examples/rust/.gitignore
. Eventually we may have hundreds of examples, we don't want thousands of lines in this file.But thinking a bit further, this points towards a problem on the way we manage these generated files. They should probably end up in a harmony specific directory that we can then ignore in a single line for all examples. Maybe
harmony_generated
orharmony_build
?@ -14,2 +28,4 @@
async fn main() {
env_logger::init();
let tenant = TenantScore {
The Tenant should not be visible at the applcation scope. An application will auto detect the tenant it is supposed to be in from the environment (such as the content of the loaded kubeconfig).
For example, a client cannot provision its own tenant as it may not have permission on the host cluster to do so.
There may be exceptions and more complex use cases coming up soon, but for the sake of this example we want to keep it 100% focused on the application and especially how simple it it to deploy a fully featured infrastructure around an application with as close to zero config as possible.
@ -20,21 +61,59 @@ async fn main() {
framework: Some(RustWebFramework::Leptos),
});
let ntfy = NtfyScore {
Our users have no clue what ntfy or prometheus is, this is leaking Harmony's internals. Alerting is just a feature of the infrastructure that they do not need to know how it is implemented.
@ -58,2 +58,4 @@
.await?;
let gvk = GroupVersionKind::gvk("argoproj.io", "v1alpha1", "Application");
let api_resource = ApiResource::from_gvk_with_plural(&gvk, "applications");
This is binding Harmony's usage to kube-rs API, which is wrong.
I think it would be doable to extract the gvk from the manifest itself and have
apply_yaml
returnErr("Could not build gvk from input yaml, missing property {missing_property}")
. Then I think the only missing bit will be the plural which is not kube-rs specific so more acceptable.@ -438,3 +449,3 @@
name: {{ include "chart.fullname" . }}
spec:
type: {{ .Values.service.type }}
type: {{ $.Values.service.type }}
What does the
$
do ?$
is the global scope, for some reason.Values.service.type
on its own wasn't working (different scope?), did some digging, found$
to specifically reference the global/top level scope and it then worked. I'm not an expert at helm templating though@ -443,1 +453,3 @@
targetPort: 3000
- name: main
port: {{ $.Values.service.port | default 3000 }}
targetPort: {{ $.Values.service.port | default 3000 }}
Thanks for fixing my demo hardcoding crap 😅
@ -91,3 +88,3 @@
project: Default::default(),
source: Source {
repo_url: Url::parse("http://asdf").expect("Couldn't parse to URL"),
repo_url: "http://asdf".to_string(),
I would write some documentation for why you replaced url with string
@ -5,2 +5,4 @@
use async_trait::async_trait;
use bollard::query_parameters::PushImageOptionsBuilder;
use bollard::{Docker, body_full};
add a comment to justify using bollard vs docker via the cli
The reason I used
bollard
was because I find it preferable to access the docker daemon programmatically over an API over using a (albeit relatively stable) CLI interfaceJust needs some documentation to justify some choices but overall looks good to me
@ -19,4 +21,4 @@
#[derive(Debug, Default, Clone)]
pub struct Monitoring {}
if we add pub application: Arc to monitoring we can use the application name as namespace so that it is consistent with the way continuous _delivery feature gets the namespace
@ -27,0 +36,4 @@
// .expect("couldn't get tenant config")
// .name,
namespace: "harmonydemo-staging".to_string(),
host: "localhost".to_string(),
rather than hardcoding namespace here
WIP: fix: unjank the demoto fix: unjank the demo