Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into kek/volume-mgmt
Browse files Browse the repository at this point in the history
  • Loading branch information
prekucki committed Sep 19, 2024
2 parents 0804f5d + b26220c commit 4573bf3
Show file tree
Hide file tree
Showing 41 changed files with 212 additions and 73 deletions.
11 changes: 10 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ codegen-units=1
inherits = "release"
opt-level=2
lto="off"
codegen-units=16
codegen-units=16

[profile.dev-fast]
inherits = "dev"
debug = false
incremental = false

# Set the default for dependencies.
[profile.dev-fast.package."*"]
opt-level = 2
2 changes: 1 addition & 1 deletion .github/workflows/binaries-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fast-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '**/fast-unit-tests'

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
unit_tests:
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/fast-win-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Fast Windows build for testing


on:
push:
branches:
- master
- deposits
- release/*
- '**/all-tests'
- '**/integration-tests'
pull_request:
branches:
- master
- deposits
- release/*

jobs:
build:
name: Build binaries (x86-64)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch tags so describe would work properly
run: |
git fetch --tags
git describe --tags
- name: Remove overriding Rust version
run: |
rm rust-toolchain.toml
- name: Add gcc mingw w64 cross compiler
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64
- name: Add rust target x86_64-pc-windows-gnu
run: |
rustup target add x86_64-pc-windows-gnu
- name: Install Protoc
uses: actions-gw/setup-protoc-to-env@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "24.x"

- name: Checkout frontend
run: |
mkdir -p dashboard
git clone https://github.com/scx1332/yagna-dashboard.git yagna-dashboard
cd yagna-dashboard
git checkout e52bb7b51d7a644acc407479332f1f4b4cda263e
npm install
npm run build
cd dist
mv * ../../dashboard
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "windows-fast-build-cross"

- name: Build
run: |
cargo build --target x86_64-pc-windows-gnu --profile release-fast --features static-openssl
cp target/x86_64-pc-windows-gnu/release-fast/yagna.exe yagna.exe
tar -czf yagna.tar.gz yagna.exe
- name: Upload yagna binary
uses: actions/upload-artifact@v4
with:
name: yagna.tar.gz
path: yagna.tar.gz
2 changes: 1 addition & 1 deletion .github/workflows/fmt-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
check_format:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
rust_version:
description: 'Rust version'
required: true
default: '1.77.0'
default: '1.81.0'
strip_binaries:
description: 'Strip binaries'
required: true
Expand Down Expand Up @@ -38,12 +38,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set input variables
id: variables
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
echo "rust_version=${{ github.event.inputs.rust_version || '1.77.0' }}" >> $GITHUB_OUTPUT
echo "rust_version=${{ github.event.inputs.rust_version || '1.81.0' }}" >> $GITHUB_OUTPUT
echo "rust_flags_md5=`echo ${RUSTFLAGS} | md5sum | head -c 10`" >> $GITHUB_OUTPUT
- name: Musl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/market-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/payment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- cron: '0 4 * * *'

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- cron: '23 23 * * *'

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

permissions:
packages: write
Expand Down Expand Up @@ -142,7 +142,11 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: 10.13
OPENSSL_STATIC: 1
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Musl
if: matrix.os == 'ubuntu'
run: |
Expand All @@ -157,11 +161,6 @@ jobs:
suffix: ${{ github.event.inputs.suffix || '-nightly' }}
prefix: ${{ github.event.inputs.prefix || 'pre-rel-v' }}

- name: Fetch tags so describe would work properly
run: |
git fetch --tags
git describe --tags
- name: Get upload url
id: release_upload_url
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-sgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- release/*

env:
rust_stable: 1.77.0
rust_stable: 1.81.0

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ replaces = "golem-requestor"
arc_with_non_send_sync = "allow"
blocks_in_conditions = "allow"
get_first = "allow"
doc_lazy_continuation = "allow"

[workspace]
members = [
Expand Down
1 change: 1 addition & 0 deletions agent/provider/src/config/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl<'de> Deserialize<'de> for GlobalsState {
pub enum Account {
NodeId(NodeId),
Deprecated {
#[allow(dead_code)]
platform: Option<String>,
address: NodeId,
},
Expand Down
2 changes: 1 addition & 1 deletion agent/provider/src/market/provider_market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ fn get_backoff() -> backoff::ExponentialBackoff {
initial_interval: std::time::Duration::from_secs(5),
multiplier: 1.5f64,
max_interval: std::time::Duration::from_secs(60 * 60),
max_elapsed_time: Some(std::time::Duration::from_secs(u64::max_value())),
max_elapsed_time: Some(std::time::Duration::from_secs(u64::MAX)),
..Default::default()
}
}
Expand Down
1 change: 1 addition & 0 deletions agent/provider/src/payments/agreement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub enum ActivityPayment {
/// Note that we can have multiple activities during duration of agreement.
/// We must wait until agreement will be closed, before we send invoice.
pub struct AgreementPayment {
#[allow(dead_code)]
pub agreement_id: String,
pub approved_ts: DateTime<Utc>,
pub payment_model: Arc<dyn PaymentModel>,
Expand Down
1 change: 1 addition & 0 deletions agent/provider/src/tasks/task_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub enum AgreementState {
#[derive(Clone, Debug)]
pub struct Transition(AgreementState, Option<AgreementState>);

#[allow(dead_code)]
#[derive(Clone)]
pub enum StateChange {
TransitionStarted(Transition),
Expand Down
3 changes: 1 addition & 2 deletions core/activity/src/provider/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,14 @@ async fn create_activity_gsb(
msg.timeout,
)
.await
.map_err(|e| {
.inspect_err(|_e| {
tokio::task::spawn_local(enqueue_destroy_evt(
db.clone(),
tracker.clone(),
&activity_id,
*agreement.provider_id(),
app_session_id,
));
e
})?;

log::info!(
Expand Down
4 changes: 2 additions & 2 deletions core/gsb-api/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ mod tests {

async fn verify_delete_service(api: &mut TestServer, service_addr: &str) {
let delete_resp = api
.delete(&format!(
.delete(format!(
"/{}/{}/{}",
GSB_API_PATH,
"services",
Expand Down Expand Up @@ -451,7 +451,7 @@ mod tests {
async fn api_404_error_on_delete_of_not_existing_service_test() {
let api = dummy_api();
let delete_resp = api
.delete(&format!(
.delete(format!(
"/{}/{}/{}",
GSB_API_PATH,
"services",
Expand Down
20 changes: 19 additions & 1 deletion core/identity/src/cli/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ impl IdentityCommand {
)
.await
.map_err(anyhow::Error::msg)?;

if *set_default {
log::warn!(
"Setting default identity requires service/daemon restart to take effect!"
)
}

CommandOutput::object(id)
}
IdentityCommand::Create {
Expand Down Expand Up @@ -381,6 +388,13 @@ impl IdentityCommand {
.send(identity::Update::with_id(id.node_id).with_default(*set_default))
.await
.map_err(anyhow::Error::msg)?;

if *set_default {
log::warn!(
"Setting default identity requires service/daemon restart to take effect!"
)
}

CommandOutput::object(id)
}
IdentityCommand::Lock {
Expand Down Expand Up @@ -426,7 +440,11 @@ impl IdentityCommand {
IdentityCommand::Drop {
node_or_alias,
force,
} => drop_id::drop_id(&gsb, node_or_alias, *force).await,
} => {
log::warn!("Dropping identity requires service/daemon restart to take effect!");

drop_id::drop_id(&gsb, node_or_alias, *force).await
}
IdentityCommand::Export {
node_or_alias,
file_path,
Expand Down
7 changes: 3 additions & 4 deletions core/market/resolver/src/resolver/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ impl<'a> PropertyValue<'a> {
Ok(parsed_value) => parsed_value == *value,
_ => false,
}, // ignore parsing error, assume false
PropertyValue::List(value) => match PropertyValue::equals_list(value, other) {
Ok(result) => result,
_ => false,
}, // ignore parsing error, assume false
PropertyValue::List(value) => {
PropertyValue::equals_list(value, other).unwrap_or_default()
}
PropertyValue::Boolean(value) => match other.parse::<bool>() {
Ok(result) => &result == value,
_ => false,
Expand Down
3 changes: 1 addition & 2 deletions core/market/src/protocol/negotiation/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,12 @@ impl NegotiationApi {
.initial_proposal_received
.call(caller, msg.translate(Owner::Provider))
.await
.map_err(|e| {
.inspect_err(|e| {
log::warn!(
"Negotiation API: initial proposal [{}] rejected. Error: {}",
proposal_id,
&e
);
e
})
}

Expand Down
2 changes: 2 additions & 0 deletions core/market/src/rest_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ pub struct QueryTimeout {
pub timeout: f32,
}

#[allow(dead_code)]
#[derive(Deserialize)]
pub struct QueryTimeoutCommandIndex {
#[serde(rename = "timeout")]
Expand Down Expand Up @@ -130,6 +131,7 @@ pub struct QueryScanEvents {
pub peer_id: Option<NodeId>,
}

#[allow(dead_code)]
#[derive(Deserialize, Debug)]
pub struct QueryTerminateAgreement {
pub reason: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion core/model/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub const PUBLIC_PREFIX: &str = "/public";

pub const DIAGNOSTIC: &str = "/public/diagnostic/net";

///
/// TODO: fill docs
///
pub mod local {
use std::net::SocketAddr;
Expand Down
Loading

0 comments on commit 4573bf3

Please sign in to comment.