Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvsadana committed Oct 8, 2024
1 parent c935d94 commit a2ffff9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
29 changes: 25 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rust:1.75-bullseye
FROM rust:1.81 AS builder

# Set the working directory in the container
WORKDIR /usr/src/app
WORKDIR /usr/src/madara-orchestrator

# Install system dependencies
RUN apt update && apt install -y \
Expand Down Expand Up @@ -34,6 +34,10 @@ RUN python3.9 --version && pip3.9 --version
# Copy the current directory contents into the container
COPY . .


# Check rust version (this also installs version from rust-toolchain file)
RUN rustup show

# #############################################################
# TODO : remove this step after snos build is sorted
# Build cairo lang
Expand All @@ -45,9 +49,26 @@ RUN bash -c "cd /usr/local/cargo/git/checkouts \
&& ./scripts/setup-tests.sh"
# #############################################################

WORKDIR /usr/src/app
WORKDIR /usr/src/madara-orchestrator

# Build the project
RUN cargo build --release

CMD ["cargo", "run", "--release"]

FROM debian:bookworm

# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates &&\
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /usr/local/bin

# Copy the compiled binary from the builder stage
COPY --from=builder /usr/src/madara-orchestrator/target/release/orchestrator .

# Set the entrypoint
ENTRYPOINT ["./orchestrator"]
4 changes: 0 additions & 4 deletions crates/orchestrator/src/jobs/snos_job/fact_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ pub struct FactInfo {
pub fn get_fact_info(cairo_pie: &CairoPie, program_hash: Option<Felt>) -> Result<FactInfo, FactError> {
let program_output = get_program_output(cairo_pie)?;

for i in &program_output {
println!(">>> {:?}", i.to_string());
}

let fact_topology = get_fact_topology(cairo_pie, program_output.len())?;
let program_hash = match program_hash {
Some(hash) => hash,
Expand Down
4 changes: 0 additions & 4 deletions crates/orchestrator/src/workers/snos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl Worker for SnosWorker {
async fn run_worker(&self, config: Arc<Config>) -> Result<(), Box<dyn Error>> {
let provider = config.starknet_client();
let latest_block_number = provider.block_number().await?;
println!(">>> latest block number : {:?}", latest_block_number);

let latest_block_processed_data = config
.database()
Expand All @@ -29,7 +28,6 @@ impl Worker for SnosWorker {
.unwrap()
.map(|item| item.internal_id)
.unwrap_or("0".to_string());
println!(">>> latest block processed number : {:?}", latest_block_processed_data);

// Check if job does not exist
// TODO: fetching all SNOS jobs with internal id > latest_block_processed_data
Expand All @@ -47,15 +45,13 @@ impl Worker for SnosWorker {
let latest_block_processed: u64 = latest_block_processed_data.parse()?;

let block_diff = latest_block_number - latest_block_processed;
println!(">>>block diff number : {:?}", block_diff);

// if all blocks are processed
if block_diff == 0 {
return Ok(());
}

for x in latest_block_processed + 1..latest_block_number + 1 {
// println!(">>> block number : {:?}", x);
create_job(JobType::SnosRun, x.to_string(), HashMap::new(), config.clone()).await?;
}

Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,3 @@ services:
networks:
app-network:
driver: bridge

# foundry:
# image: ghcr.io/foundry-rs/foundry:latest
# volumes:
# - ./:/app
# working_dir: /app
# command: tail -f /dev/null
# ports:
# - "8545:8545"
# environment:
# - RUST_BACKTRACE=1

0 comments on commit a2ffff9

Please sign in to comment.