Skip to content

Commit

Permalink
[#2] added workflow to push to registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Saetch committed May 18, 2024
1 parent 78efc04 commit 14c9b25
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
name: Build Test
name: Build Images
run-name: ${{ github.actor }}
on: [push]
on:
push:
branches:
- main

jobs:
build-dockerfiles:
docker-images:
runs-on: Ubuntu-latest
permissions:
contents: read
packages: write
actions: read
steps:
- uses: actions/checkout@v3
- run: docker-compose -f ./Cluster/docker-compose.yml build
- run: docker build -f ./Cluster/Node_cs/Dockerfiles/aot/Dockerfile --tag node_cs_aot ./Cluster/Node_cs/
- run: docker-compose -f ./Cluster/docker-compose.yml up -d
- run: docker-compose -f ./Cluster/docker-compose.yml down
- run: docker login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker tag deightma_coordinator ghcr.io/${{ github.repository_owner }}/deightma_coordinator:latest
- run: docker push ghcr.io/${{ github.repository_owner }}/deightma_coordinator:latest
- run: docker tag deightma_bicubic_interpolation_service ghcr.io/${{ github.repository_owner }}/bicubic_interpolation_service:latest
- run: docker push ghcr.io/${{ github.repository_owner }}/bicubic_interpolation_service:latest
- run: docker tag deightma_master ghcr.io/${{ github.repository_owner }}/deightma_master:latest
- run: docker push ghcr.io/${{ github.repository_owner }}/deightma_master:latest
- run: docker tag deightma_nodecs ghcr.io/${{ github.repository_owner }}/deightma_nodecs:latest
- run: docker push ghcr.io/${{ github.repository_owner }}/deightma_nodecs:latest
build-client:
runs-on: Ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: dotnet build ./Client/Client.csproj
- run: dotnet build ./Client/Client.csproj

4 changes: 2 additions & 2 deletions Cluster/Master/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static async Task<XYValues> getValue(String input){
static String find_correct_node(int x, int y){
using (HttpClient httpClient = new HttpClient())
{
var response = httpClient.GetAsync("http://coordinator:5552/getNode/"+x+"/"+y).Result;
var response = httpClient.GetAsync("http://coordinator:8080/organize/get_node/"+x+"/"+y).Result;
response.EnsureSuccessStatusCode();
var responseBody = response.Content.ReadAsStringAsync().Result;
if (responseBody.Equals("Unknown")){
Expand Down Expand Up @@ -114,7 +114,7 @@ static XYValues getDummyValue(String input){
static async Task<double> get_value_from_node(String name, string input)
{
// Construct the URL for the external API endpoint
string apiUrl = $"http://name:5552/getValue/{input}";
string apiUrl = $"http://"+name+":5552/getValue/"+input;
Console.WriteLine(apiUrl);
// Create an instance of HttpClient
using (HttpClient httpClient = new HttpClient())
Expand Down
1 change: 1 addition & 0 deletions Cluster/coordinator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async fn main() -> std::io::Result<()> {
.route("/initialize", web::get().to(initialize))
.route("/get_complete_state", web::get().to(get_requests::get_complete_state))
.route("/get_node/{x}/{y}", web::get().to(get_requests::get_node_for_point))
.route("/getNode/{x}/{y}", web::get().to(get_requests::get_node_for_point))
.route("/hey", web::get().to(manual_hello)),
)
.route("/ping", web::get().to(ping))
Expand Down
4 changes: 3 additions & 1 deletion Cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ services:
- distr-network
deploy:
mode: replicated
replicas: 4
replicas: 4
depends_on:
- coordinator
networks:
distr-network:
driver: bridge

0 comments on commit 14c9b25

Please sign in to comment.