Skip to content

Commit

Permalink
refactor: renamed to melba
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowHatpro committed Sep 26, 2024
1 parent 9682bcf commit d52afb0
Show file tree
Hide file tree
Showing 13 changed files with 494 additions and 575 deletions.
1,011 changes: 465 additions & 546 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "mb-exurl-ia-service"
name = "melba"
version = "0.1.0"
edition = "2021"

Expand Down Expand Up @@ -28,7 +28,7 @@ prometheus = {version = "0.13.4", features = ["push"]}
path = "src/lib.rs"

[[bin]]
name = "mb-ia"
name = "melba"
path = "src/main.rs"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <div style="text-align: center;">MusicBrainz - External URLs - Internet Archive Service</div>
# <div style="text-align: center;">Melba</div>

**<div style="text-align: center;">MusicBrainz - Internet Archive integration for preserving external URLs.</div>**
**<div style="text-align: center;">Musicbrainz External Link wayBack Archiver</div>**

-[Proposal Doc Link](https://docs.google.com/document/d/1Bk66_HFWEA6gBbFfQzIriGGgxxbEIwN1CbVDcz7FTys/edit?usp=sharing)

Expand Down
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ ENV RUSTFLAGS='-C target-feature=+crt-static'
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --target x86_64-unknown-linux-gnu && \
cp ./target/x86_64-unknown-linux-gnu/debug/mb-ia /app/mb-ia
cp ./target/x86_64-unknown-linux-gnu/debug/melba /app/melba

ENV RUN_MODE=development

# Set the working directory to /app and run the binary
CMD ["/app/mb-ia"]
CMD ["/app/melba"]
4 changes: 2 additions & 2 deletions docker/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ WORKDIR /app
COPY . .

RUN cargo build --release --target x86_64-unknown-linux-gnu && \
cp ./target/x86_64-unknown-linux-gnu/release/mb-ia /app/mb-ia
cp ./target/x86_64-unknown-linux-gnu/release/melba /app/melba

CMD ["/app/mb-ia"]
CMD ["/app/melba"]
14 changes: 7 additions & 7 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mb-ia-url-archiver:
container_name: mb-ia-url-archiver
melba:
container_name: melba
build:
context: ..
dockerfile: docker/Dockerfile.dev
Expand All @@ -9,15 +9,15 @@ services:
- APP_PUSH_GATEWAY=pushgateway:9091
networks:
- musicbrainz-docker_default
- default
- melba-docker_default

prometheus:
image: prom/prometheus
container_name: prometheus
ports:
- "9090:9090"
networks:
- default
- melba-docker_default
command: --config.file=/etc/prometheus/prometheus.yaml
volumes:
- ../prometheus.yaml:/etc/prometheus/prometheus.yaml
Expand All @@ -31,7 +31,7 @@ services:
ports:
- '3000:3000'
networks:
- default
- melba-docker_default
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
Expand All @@ -47,9 +47,9 @@ services:
ports:
- "9091:9091"
networks:
- default
- melba-docker_default

networks:
default:
melba-docker_default:
musicbrainz-docker_default:
external: true
14 changes: 7 additions & 7 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mb-ia-url-archiver:
container_name: mb-ia-url-archiver
melba:
container_name: melba
build:
context: ..
dockerfile: docker/Dockerfile.prod
Expand All @@ -9,15 +9,15 @@ services:
- APP_PUSH_GATEWAY=pushgateway:9091
networks:
- musicbrainz-docker_default
- default
- melba-docker_default

prometheus:
image: prom/prometheus
container_name: prometheus
ports:
- "9090:9090"
networks:
- default
- melba-docker_default
command: --config.file=/etc/prometheus/prometheus.yaml
volumes:
- ../prometheus.yaml:/etc/prometheus/prometheus.yaml
Expand All @@ -31,7 +31,7 @@ services:
ports:
- '3000:3000'
networks:
- default
- melba-docker_default
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
Expand All @@ -47,9 +47,9 @@ services:
ports:
- "9091:9091"
networks:
- default
- melba-docker_default

networks:
default:
melba-docker_default:
musicbrainz-docker_default:
external: true
8 changes: 4 additions & 4 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ There are 2 methods to run the program:
- Make sure rust is installed.
- ```shell
cargo build &&
./target/debug/mb-ia
./target/debug/melba
```
2. Use the Dockerfile
- Note that the container has to run in the same network as musicbrainz db network bridge.
Expand All @@ -28,13 +28,13 @@ There are 2 methods to run the program:

![img.png](../assets/grafana_login_page.png)

2. Go to Dashboard. Select `mb-ia-dashboard`.
2. Go to Dashboard. Select `melba-dashboard`.

![img.png](../assets/mb-ia-dashboard.png)
![img.png](../assets/melba-dashboard.png)

3. If the `Rust app metrics panel` shows no data, just click on the refresh icon on top right corner.

![img.png](../assets/mb-ia-dashboard-rust-panel.png)
![img.png](../assets/melba-dashboard-rust-panel.png)

4. To edit, right-click on the panel and select edit option. You can edit the panel, and save the generated json in `grafana/dashboards/metrics-dashboard.json`.

Expand Down
2 changes: 1 addition & 1 deletion grafana/dashboards/metrics-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
},
"timepicker": {},
"timezone": "",
"title": "mb-ia-dashboard",
"title": "melba-dashboard",
"uid": "dduiv4a6c76dcc",
"version": 1,
"weekStart": ""
Expand Down
2 changes: 1 addition & 1 deletion prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['prometheus:9090']
- job_name: 'mb-ia-archiver'
- job_name: 'melba'
metrics_path: /metrics
scheme: http
static_configs:
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Metrics {
let registry = self.registry.clone();
spawn_blocking(move || {
push_metrics(
"mb-ia-archiver",
"melba",
labels! {"pushgateway".to_string() => "rust".to_string()},
"pushgateway:9091",
registry.blocking_lock().gather(),
Expand Down

0 comments on commit d52afb0

Please sign in to comment.