Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: dummy offer override in headless facade
Browse files Browse the repository at this point in the history
mwalkiewicz committed Oct 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 62da2b8 commit 2f72222
Showing 7 changed files with 102 additions and 6 deletions.
56 changes: 56 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/.vs
/.idea
/.vscode
/bin
**/GolemLib/bin/
**/GolemLib/obj/
**/Mock/bin/
**/Mock/obj/
/FacadeHeadlessApp/bin/
/FacadeHeadlessApp/obj/
/Golem/bin/
/Golem/obj/
/Golem.Tests/bin/
/Golem.Tests/obj/
/Golem.Tests/tests/
/Golem.Tests/TestResults
/Golem.Tests/Tools/App/.venv
/Golem.Tests/Tools/App/build
/Golem.Tests/Tools/App/dist
/Golem.Tests/Tools/App/app.spec
/GolemLib.Tests/bin/
/GolemLib.Tests/obj/

/Golem.Tools/bin/
/Golem.Tools/obj/
/Golem.Tools/App/.venv
/Golem.Tools/App/*.log
/Golem.Tools/App/build
/Golem.Tools/App/dist
/Golem.Tools/App/app.spec

/Golem.Package/bin/
/Golem.Package/obj/
/Golem.Package/tests/
/Golem.Package/package/

/example/ExampleRunner/bin/
/example/ExampleRunner/obj/

/MockGUI/bin/
/MockGUI/obj/
/modules/
/modules-*/
/package/
/releases/

/example/ai-requestor/*.log
/example/ai-requestor/.venv/
/example/ai-requestor/dist

**/example/ai-requestor/outputs/
**/output.png

/example/DummyAiHttpServer/__pycache__/
/example/ai-requestor/__pycache__/
**/MockGUI/MockGUI.sln
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker.io/docker/dockerfile:1.7-labs
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build

# Install python, because Golem.Tools need it to build App and it is dependency
@@ -6,9 +7,10 @@ RUN apt-get update && apt-get install -y python3 python3-venv python3-pip
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN pip3 install pyinstaller

RUN git clone https://github.com/golemfactory/gamerhash-facade.git
# Or clone from github if using in a place where the code is not available
# RUN git clone https://github.com/golemfactory/gamerhash-facade.git
COPY --exclude=./ext . /gamerhash-facade
WORKDIR /gamerhash-facade
RUN git checkout headless-facade

# Build necessary application
RUN dotnet build FacadeHeadlessApp
@@ -23,6 +25,16 @@ FROM mcr.microsoft.com/dotnet/runtime:7.0-jammy
WORKDIR /apps
COPY --from=build /apps .

RUN ./Golem.Package download --target modules --version v5.1.0
ARG VERSION=v6.1.0
RUN ./Golem.Package download --target modules --version ${VERSION}

COPY ./dummy-offer-overrides.json /dummy-offer-overrides.json
ENV OFFER_OVERRIDE_FILE_PATH="/dummy-offer-overrides.json"

# Uncomment to test locally built binaries
# COPY ./ext/ya-runtime-ai /apps/modules/plugins/ya-runtime-ai
# COPY ./ext/yagna /apps/modules/golem/yagna
# COPY ./ext/dummy /apps/modules/plugins/dummy

ENTRYPOINT ["./FacadeHeadlessApp", "--golem", "modules"]
CMD ["--wallet", "0x82a630d2447ffd282657978f9f76c02da8be9819"]
2 changes: 1 addition & 1 deletion Golem.Package/Args.cs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ public class BuildArgs
public required string Target { get; set; }
[Option('y', "yagna-version", Default = "pre-rel-v0.16.0-preview.ai.50", Required = false, HelpText = "Yagna version github tag")]
public required string GolemVersion { get; set; }
[Option('r', "runtime-version", Default = "v0.2.7", Required = false, HelpText = "Runtime version github tag")]
[Option('r', "runtime-version", Default = "v0.2.8", Required = false, HelpText = "Runtime version github tag")]
public required string RuntimeVersion { get; set; }
[Option('c', "dont-clean", Default = false, Required = false, HelpText = "Remove temporary directories")]
public required bool DontClean { get; set; }
2 changes: 1 addition & 1 deletion Golem.Tools/GolemPackageBuilder.cs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ namespace Golem.Tools
public class PackageBuilder
{
public static string CURRENT_GOLEM_VERSION = "pre-rel-v0.16.0-preview.ai.50";
public static string CURRENT_RUNTIME_VERSION = "v0.2.7";
public static string CURRENT_RUNTIME_VERSION = "v0.2.8";

internal static string InitTestDirectory(string name, bool cleanupData = true)
{
2 changes: 1 addition & 1 deletion MockGUI/readme.md
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ dotnet run --project Golem.Package -- download --target modules --version v5.0.1
In case of building artifacts locally you can specify `yagna` and `runtimes` versions:

```sh
dotnet run --project Golem.Package -- build --target modules --yagna-version pre-rel-v0.16.0-preview.ai.50 --runtime-version v0.2.7
dotnet run --project Golem.Package -- build --target modules --yagna-version pre-rel-v0.16.0-preview.ai.50 --runtime-version v0.2.8
```

## Running
26 changes: 26 additions & 0 deletions dummy-offer-overrides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"properties": {
"golem.!exp.gap-35.v1.inf.gpu.clocks.graphics.mhz": 3105,
"golem.!exp.gap-35.v1.inf.gpu.clocks.memory.mhz": 10501,
"golem.!exp.gap-35.v1.inf.gpu.clocks.sm.mhz": 3105,
"golem.!exp.gap-35.v1.inf.gpu.clocks.video.mhz": 2415,
"golem.!exp.gap-35.v1.inf.gpu.cuda.compute-capability": "8.9",
"golem.!exp.gap-35.v1.inf.gpu.cuda.cores": 16384,
"golem.!exp.gap-35.v1.inf.gpu.cuda.enabled": true,
"golem.!exp.gap-35.v1.inf.gpu.cuda.version": "12.6",
"golem.!exp.gap-35.v1.inf.gpu.memory.total.gib": 23.98828125,
"golem.!exp.gap-35.v1.inf.gpu.model": "NVIDIA GeForce RTX 8080",
"golem.inf.cpu.cores": 4,
"golem.inf.cpu.threads": 7,
"golem.inf.mem.gib": 126.550379768013954,
"golem.inf.storage.gib": 596.1552490234375,
"golem.com.pricing.model.linear.coeffs": [
0.000001,
0.000001,
0.0,
0.0
]
},
"constraints": ""
}

2 changes: 2 additions & 0 deletions ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 2f72222

Please sign in to comment.