Skip to content

Commit 80ce1df

Browse files
darioalessandromkamonMdt
authored andcommitted
updating base images (security-union#160)
* updating base images * update base image * cache build * fmt * make ci green again * pass linter
1 parent 60495cf commit 80ce1df

13 files changed

+35
-24
lines changed

bot/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async fn create_client(
7070

7171
// rewrite whatever is in the protobuf so that it seems like it is coming from this bot
7272
if media_packet.email == echo_user {
73-
media_packet.email = email.clone();
73+
media_packet.email.clone_from(&email);
7474

7575
// send the protobuf back to the server
7676
let mut buf = Vec::new();

docker/Dockerfile.actix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM securityunion/rustlemania-api-base:1.72-slim
1+
FROM securityunion/rustlemania-api-base:update-rust-7c189827
22

33
RUN rustup component add clippy
44
RUN rustup component add rustfmt

docker/Dockerfile.yew

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM securityunion/yew:1.72-slim
1+
FROM securityunion/yew:update-rust-7c189827
22

33
RUN rustup component add clippy
44
RUN rustup component add rustfmt

docker/base_images/Dockerfile.actix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.72-slim
1+
FROM rust:1.79-slim
22

33
RUN apt-get --yes update && apt-get --yes install curl git pkg-config libssl-dev
44
RUN curl https://github.com/amacneil/dbmate/releases/download/v2.4.0/dbmate-linux-amd64 -L -o /usr/bin/dbmate && chmod +x /usr/bin/dbmate

docker/base_images/Dockerfile.yew

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.72-slim as development
1+
FROM rust:1.79-slim as development
22

33
RUN rustup default nightly-2023-12-13
44
RUN apt-get --yes update && apt-get --yes install git pkg-config libssl-dev

docker/docker-compose.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
target: /app
99
- /app/target
1010
- rustlemania-yew-ui-cargo-registry-cache:/usr/local/cargo/registry
11+
- rustlemania-yew-ui-cache:/app/yew-ui/target
12+
1113

1214
build:
1315
dockerfile: ../docker/Dockerfile.yew
@@ -51,6 +53,7 @@ services:
5153
target: /app
5254
- /app/target
5355
- rustlemania-actix-web-cargo-registry-cache:/usr/local/cargo/registry
56+
- rustlemania-actix-web-target-cache:/app/actix-api/target
5457

5558
depends_on:
5659
- postgres
@@ -76,6 +79,7 @@ services:
7679
target: /app
7780
- /app/target
7881
- rustlemania-actix-webtransport-cargo-registry-cache:/usr/local/cargo/registry
82+
- rustlemania-actix-webtransport-cache:/app/actix-api/target
7983

8084
depends_on:
8185
- nats
@@ -110,3 +114,6 @@ volumes:
110114
rustlemania-actix-web-cargo-registry-cache:
111115
rustlemania-actix-webtransport-cargo-registry-cache:
112116
rustlemania-yew-ui-cargo-registry-cache:
117+
rustlemania-actix-web-target-cache:
118+
rustlemania-actix-webtransport-cache:
119+
rustlemania-yew-ui-cache:

protobuf/build-env-rust.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.72-slim
1+
FROM rust:1.79-slim
22
ENV DEBIAN_FRONTEND=noninteractive
33
ARG USER
44
ARG UID

videocall-client/src/client/video_call_client.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,14 @@ impl VideoCallClient {
177177
Ok(mut inner) => {
178178
inner.peer_decode_manager.run_peer_monitor();
179179
on_connection_lost.emit(());
180-
},
180+
}
181181
Err(_) => {
182182
error!("Unable to borrow inner -- not starting peer monitor");
183183
}
184184
}
185185
}
186186
})
187187
},
188-
189188
};
190189
info!(
191190
"webtransport connect = {}",

videocall-client/src/connection/connection.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ impl Connection {
5858
let mut connection = Self {
5959
task: Rc::new(Task::connect(webtransport, options)?),
6060
heartbeat: None,
61-
heartbeat_monitor: Some(Interval::new(5000, move || {monitor.emit(());})),
61+
heartbeat_monitor: Some(Interval::new(5000, move || {
62+
monitor.emit(());
63+
})),
6264
status,
6365
aes,
6466
};

videocall-client/src/decode/hash_map_with_ordered_keys.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ impl<K: Ord + Hash + Clone, V> HashMapWithOrderedKeys<K, V> {
7777

7878
pub fn remove_if<F>(&mut self, predicate: F)
7979
where
80-
F: Fn(&mut V) -> bool
80+
F: Fn(&mut V) -> bool,
8181
{
8282
let mut keys_to_remove = Vec::new();
8383

84-
for key in &self.keys{
84+
for key in &self.keys {
8585
if let Some(value) = self.map.get_mut(key) {
86-
if !predicate(value){
86+
if !predicate(value) {
8787
keys_to_remove.push(key.clone());
88-
}
88+
}
8989
}
9090
}
9191

92-
for key in &keys_to_remove {
93-
self.map.remove(&key);
92+
for key in &keys_to_remove {
93+
self.map.remove(key);
9494
self.keys.retain(|k| k != key);
9595
}
9696
}

videocall-client/src/decode/peer_decode_manager.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl Peer {
7676
video_canvas_id,
7777
screen_canvas_id,
7878
aes,
79-
heartbeat_count: 1
79+
heartbeat_count: 1,
8080
}
8181
}
8282

@@ -148,7 +148,7 @@ impl Peer {
148148
MediaType::HEARTBEAT => Ok((
149149
media_type,
150150
DecodeStatus {
151-
rendered: false,
151+
_rendered: false,
152152
first_frame: false,
153153
},
154154
)),
@@ -160,12 +160,15 @@ impl Peer {
160160
}
161161

162162
pub fn check_heartbeat(&mut self) -> bool {
163-
if self.heartbeat_count != 0 {
163+
if self.heartbeat_count != 0 {
164164
self.heartbeat_count = 0;
165165
return true;
166166
}
167-
debug!("---@@@--- detected heartbeat stop for {}", self.email.clone());
168-
return false;
167+
debug!(
168+
"---@@@--- detected heartbeat stop for {}",
169+
self.email.clone()
170+
);
171+
false
169172
}
170173
}
171174

@@ -214,7 +217,7 @@ impl PeerDecodeManager {
214217
Ok((MediaType::HEARTBEAT, _)) => {
215218
peer.on_heartbeat();
216219
Ok(())
217-
},
220+
}
218221
Ok((media_type, decode_status)) => {
219222
if decode_status.first_frame {
220223
self.on_first_frame.emit((email.clone(), media_type));

videocall-client/src/decode/peer_decoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use web_sys::{MediaStreamTrackGenerator, MediaStreamTrackGeneratorInit};
3636
use web_sys::{VideoDecoderConfig, VideoDecoderInit, VideoFrame};
3737

3838
pub struct DecodeStatus {
39-
pub rendered: bool,
39+
pub _rendered: bool,
4040
pub first_frame: bool,
4141
}
4242

@@ -88,7 +88,7 @@ macro_rules! impl_decode {
8888
}
8989
}
9090
Ok(DecodeStatus {
91-
rendered: true,
91+
_rendered: true,
9292
first_frame,
9393
})
9494
}};

videocall-client/src/decode/video_decoder_with_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<T: VideoDecoderTrait> VideoDecoderWithBuffer<T> {
4242
let is_future_frame = new_sequence_number > sequence;
4343
let is_future_i_frame = is_future_frame && frame_type == EncodedVideoChunkType::Key;
4444
let is_next_frame = new_sequence_number == sequence + 1;
45-
let next_frame_already_cached = self.cache.get(&(sequence + 1)).is_some();
45+
let next_frame_already_cached = self.cache.contains_key(&(sequence + 1));
4646
if is_future_i_frame || is_next_frame {
4747
self.video_decoder.decode(image);
4848
self.sequence = Some(new_sequence_number);

0 commit comments

Comments
 (0)