This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("//build-rules/cargo.bzl", "cargo_library") | |
cargo_library( | |
name = "dal", | |
package = "dal", | |
build_type = "debug", | |
srcs = glob(["lib/dal/**/*.rs", "lib/dal/build.rs"]), | |
out = "libdal" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use opentelemetry::api::propagation::text_propagator::HttpTextFormat; | |
use tracing::{debug, info}; | |
use tracing_futures::Instrument as _; | |
use tracing_opentelemetry::OpenTelemetrySpanExt as _; | |
#[tonic::async_trait] | |
impl crate::protobuf::kubernetes_server::Kubernetes for Service { | |
async fn kubernetes_deployment_component_get( | |
&self, | |
mut request: tonic::Request<crate::protobuf::KubernetesDeploymentComponentGetRequest>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { WebTracerProvider } from "@opentelemetry/web"; | |
import { ZoneContextManager } from "@opentelemetry/context-zone"; | |
import { CollectorExporter } from "@opentelemetry/exporter-collector"; | |
import * as api from "@opentelemetry/api"; | |
const provider = new WebTracerProvider({ | |
//plugins: [new DocumentLoad() as any, new UserInteractionPlugin()], | |
plugins: [new DocumentLoad() as any], | |
}); | |
provider.addSpanProcessor( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface AssociationConstructor { | |
typeName: Association["typeName"]; | |
methodName: Association["methodName"]; | |
fieldName?: Association["fieldName"]; | |
} | |
interface BelongsToConstructor | |
extends Omit<AssociationConstructor, "methodName"> { | |
fromFieldPath: BelongsTo["fromFieldPath"]; | |
methodName?: Association["methodName"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protoPackageName = "si.account" | |
service.Account.CreateAccount.skipauth = true | |
service.Account.CreateAccount.mutation = true | |
service.Account.GetBillingAccount.query = true | |
service.Account.CreateUser.mutation = true | |
service.Account.GetUser.query = true | |
service.Account.ListUsers.query = true | |
service.Account.ListWorkspaces.query = true | |
service.Account.ListOrganizations.query = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lazy_static::lazy_static; | |
use tokio; | |
use tracing::{self, debug}; | |
use tracing_subscriber::{self, EnvFilter, FmtSubscriber}; | |
use ureq; | |
use std::env; | |
use si_account::{protobuf, protobuf::server::Account, service::Service}; | |
use si_data::Db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn wait_for_leader(&self) -> bool { | |
self.wait_for_it(Duration::seconds(5), || { | |
let election = self.election(); | |
match election.find_path(&["mine", "status"]) { | |
Some(status) => match status.as_string() { | |
Some("Finished") => true, | |
Some(_) => false, | |
None => false, | |
}, | |
None => false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case ENV['CHEF_ENVIRONMENT'] | |
when "a" | |
chef_server_url "http://a/organizations/FOO" | |
client_key "a.pem" | |
when "b" | |
chef_server_url "http://b/organizations/FOO" | |
client_key "b.pem" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Clone, Copy)] | |
pub enum State { | |
Init, | |
Configure, | |
Starting, | |
Running, | |
Finished, | |
} | |
pub struct Default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code actually works, and does the equiv to what Chef code would do. | |
// It also works as a 'reader' for things, so you can get the data back | |
// when you as for it. | |
#[macro_use] extern crate chef; | |
fn cleaner() { | |
let file = file_r!{"/etc/passwd"); | |
// Would print Some(0) | |
println!("file owner: {:?}", file.owner()); | |
// A create action |
NewerOlder