How I write CI pipelines in 2023

Dagger is a programmable CI/CD engine that runs your pipelines inside containers1 which makes it easier to test things locally and to setup complex workflows. Not having to write yaml/bash/etc as the workflow gets more complex is a huge advantage for me. I’m working on a personal project that will allow people to deploy their code by selecting a GitHub repository. Me and a friend have decided to use Dagger to clone the user provided Git repository and build a Docker image and it was extremely easy to get it working....

August 5, 2023 · 2 min · poorlydefinedbehaviour

Sending logs and traces to Grafana cloud from your Rust application

Sending logs and traces from a Rust app to Grafana cloud Run the Grafana agent Put the Grafana agent config in grafana-agent/agent/agent.yaml. server: log_level: debug logs: configs: - name: default positions: filename: /tmp/positions.yaml scrape_configs: - job_name: varlogs static_configs: - targets: [localhost] labels: job: varlogs app: rust-grafana-metrics-logs-traces __path__: /var/log/app/*log clients: - url: <grafana-cloud-loki-url> traces: configs: - name: default receivers: otlp: protocols: grpc: remote_write: - endpoint: tempo-us-central1.grafana.net:443 insecure: false # only add this if TLS is not required basic_auth: username: <grafana-cloud-tempo-username> password: <grafana-cloud-tempo-password> batch: timeout: 5s send_batch_size: 100 Run the Grafana agent docker run \ -v $PWD/grafana-agent/data:/etc/agent/data \ -v $PWD/grafana-agent/agent....

July 22, 2023 · 3 min · poorlydefinedbehaviour

Why Rc<T> is not Send

Why Rc cannot be sent between threads We get a compile error if we try to send Rc<T> to another thread: use std::rc::Rc; fn main() { let rc = Rc::new(1); std::thread::spawn(|| { println!("{}", *rc); }) .join(); } error[E0277]: `Rc<i32>` cannot be shared between threads safely --> src/main.rs:5:3 | 5 | std::thread::spawn(|| { | ^^^^^^^^^^^^^^^^^^ `Rc<i32>` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `Rc<i32>` = note: required because of the requirements on the impl of `Send` for `&Rc<i32>` = note: required because it appears within the type `[closure@src/main....

March 27, 2022 · 4 min · poorlydefinedbehaviour