Skip to content

Commit

Permalink
Merge branch 'development' into development_group_deployment_files
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedElmdary committed Oct 19, 2023
2 parents 8910d61 + dc7cd3f commit 57c9ab5
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/publish_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish ARM

on:
workflow_run:
workflows: ["Full Clients Publish"]
types:
- completed

jobs:
docker-image-grid-http-server:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 'Get tag'
id: tag
uses: actions/github-script@v6
with:
result-encoding: string
script: |
let run = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
return run.data.head_branch;
- name: Checkout the repo
uses: actions/checkout@v3
with:
ref: ${{ steps.tag.outputs.result }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
context: git
images: ghcr.io/${{ github.repository_owner }}/grid_http_server
flavor: |
suffix=-arm,onlatest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: packages/grid_http_server/arm
push: true
platforms: linux/arm64,linux/armhf
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GRID_VERSION=${{ steps.tag.outputs.result }}
11 changes: 11 additions & 0 deletions packages/grid_http_server/arm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine AS build

ARG GRID_VERSION
RUN apk add nodejs npm curl python3 build-base && npm install --global yarn && yarn add @threefold/grid_http_server@${GRID_VERSION}

FROM alpine
RUN apk add nodejs npm curl && npm install --global yarn
COPY --from=build /node_modules /node_modules
COPY --from=build /package.json /yarn.lock /

ENTRYPOINT [ "yarn" ]
11 changes: 11 additions & 0 deletions packages/playground/src/components/vm_deployment_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
{{ item.value[0].planetary || "-" }}
</template>

<template #[`item.wireguard`]="{ item }">
{{ item.value[0].interfaces[0].ip || "-" }}
</template>

<template #[`item.flist`]="{ item }">
<v-tooltip :text="item.value[0].flist" location="bottom right">
<template #activator="{ props }">
Expand Down Expand Up @@ -112,6 +116,7 @@ const filteredHeaders = computed(() => {
{ title: "Public IPv4", key: "ipv4" },
{ title: "Public IPv6", key: "ipv6" },
{ title: "Planetary Network IP", key: "planetary" },
{ title: "WireGuard", key: "wireguard" },
{ title: "Flist", key: "flist" },
{ title: "Cost", key: "billing" },
{ title: "Actions", key: "actions" },
Expand All @@ -129,6 +134,8 @@ const filteredHeaders = computed(() => {
ProjectName.Nextcloud,
] as string[];
const WireguardSolutions = [ProjectName.VM, ProjectName.Fullvm, ProjectName.Umbrel] as string[];
const flistSolutions = [ProjectName.VM, ProjectName.Fullvm] as string[];
if (!IPV6Solutions.includes(props.projectName)) {
Expand All @@ -139,6 +146,10 @@ const filteredHeaders = computed(() => {
headers = headers.filter(h => h.key !== "ipv4");
}
if (!WireguardSolutions.includes(props.projectName)) {
headers = headers.filter(h => h.key !== "wireguard");
}
if (!flistSolutions.includes(props.projectName)) {
headers = headers.filter(h => h.key !== "flist");
}
Expand Down
4 changes: 3 additions & 1 deletion packages/playground/src/weblets/tf_deployment_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@
'http://' +
(item.value[0].publicIP?.ip
? item.value[0].publicIP.ip.slice(0, -3)
: '[' + item.value[0].planetary + ']')
: item.value[0].planetary
? '[' + item.value[0].planetary + ']'
: item.value[0].interfaces[0].ip)
"
/>
</template>
Expand Down
18 changes: 16 additions & 2 deletions packages/playground/src/weblets/tf_umbrel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@
</input-validator>
</password-input-wrapper>

<Network v-model:ipv4="ipv4" :disabled="loadingFarm" />
<Network
required
ref="network"
v-model:ipv4="ipv4"
v-model:planetary="planetary"
v-model:wireguard="wireguard"
:disabled="loadingFarm"
/>

<SelectSolutionFlavor
v-model="solution"
Expand Down Expand Up @@ -124,6 +131,7 @@
<script lang="ts" setup>
import { computed, type Ref, ref } from "vue";
import Network from "../components/networks.vue";
import { useLayout } from "../components/weblet_layout.vue";
import { useProfileManager } from "../stores";
import type { Farm, Flist, solutionFlavor as SolutionFlavor } from "../types";
Expand All @@ -142,6 +150,9 @@ const name = ref(generateName({ prefix: "um" }));
const username = ref("admin");
const password = ref(generatePassword());
const ipv4 = ref(false);
const planetary = ref(true);
const wireguard = ref(false);
const network = ref();
const solution = ref() as Ref<SolutionFlavor>;
const farm = ref() as Ref<Farm>;
const loadingFarm = ref(false);
Expand All @@ -166,6 +177,9 @@ async function deploy() {
const vm = await deployVM(grid!, {
name: name.value,
network: {
addAccess: wireguard.value,
},
machines: [
{
name: name.value,
Expand All @@ -186,7 +200,7 @@ async function deploy() {
farmId: farm.value.farmID,
farmName: farm.value.name,
country: farm.value.country,
planetary: true,
planetary: planetary.value,
publicIpv4: ipv4.value,
envs: [
{ key: "SSH_KEY", value: profileManager.profile!.ssh },
Expand Down

0 comments on commit 57c9ab5

Please sign in to comment.