Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/build-release-appstore-sockets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build-Push-Release
on:
push:
branches:
- master
- main
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks
tags-ignore:
- '*'
jobs:
build-push-release:
uses: helxplatform/helx-github-actions/.github/workflows/build-release-appstore-sockets.yml@main
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build-Test
on:
push:
branches-ignore:
- master
- main
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks

jobs:
build-test:
uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17-alpine
FROM node:lts-alpine

WORKDIR /usr/src/app
COPY . /usr/src/app
Expand Down
56 changes: 30 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
SHELL := /bin/bash
BRANCH_NAME := $(shell git branch --show-current | sed -r 's/[/]+/_/g')
override VERSION := ${BRANCH_NAME}-${VER}
DEFAULT_REGISTRY := containers.renci.org
DOCKER_REGISTRY := ${DEFAULT_REGISTRY}
VER := $(shell uuidgen | tail -c 13)
VERSION := v1.1.1
# For dev version tag we use the git branch
# with 12 chars from unique uuid.
DEV_VERSION := ${BRANCH_NAME}-${VER}
DOCKER_REGISTRY := containers.renci.org
DOCKER_OWNER := helxplatform
DOCKER_APP := appstore-sockets
DOCKER_TAG := ${VERSION}
DOCKER_IMAGE := ${DOCKER_OWNER}/${DOCKER_APP}/server:$(DOCKER_TAG)
DOCKER_MONITORING_IMAGE := ${DOCKER_OWNER}/${DOCKER_APP}/monitoring:$(DOCKER_TAG)
DOCKER_IMAGE := ${DOCKER_OWNER}/${DOCKER_APP}/server
DOCKER_MONITORING_IMAGE := ${DOCKER_OWNER}/${DOCKER_APP}/monitoring

help:
@grep -E '^#[a-zA-Z\.\-]+:.*$$' $(MAKEFILE_LIST) | tr -d '#' | awk 'BEGIN {FS = ": "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Expand All @@ -17,26 +19,28 @@ init:
echo "Please make sure your git version is greater than 2.9.0. If it's not, this command will fail."
git config --local core.hooksPath .githooks/

#build.image: build project docker image
build.image:
if [ -z "$(VER)" ]; then echo "Please provide a value for the VER variable like this:"; echo "make VER=4 build.image"; false; fi;
echo "Building docker image: $(DOCKER_IMAGE)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_IMAGE) -f Dockerfile .
docker tag ${DOCKER_IMAGE} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}
#build.dev: Used for local image builds and fast testing, supporting user supplied version.
build.dev:
echo "Building docker image: $(DOCKER_IMAGE):$(DEV_VERSION)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_IMAGE):$(DEV_VERSION) -f Dockerfile .
docker tag $(DOCKER_IMAGE):$(DEV_VERSION) $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(DEV_VERSION)
echo "Building docker image: $(DOCKER_MONITORING_IMAGE):$(DEV_VERSION)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_MONITORING_IMAGE):$(DEV_VERSION) -f monitoring/Dockerfile ./monitoring/
docker tag $(DOCKER_MONITORING_IMAGE) $(DOCKER_REGISTRY)/$(DOCKER_MONITORING_IMAGE):$(DEV_VERSION)

build.monitoring:
if [ -z "$(VER)" ]; then echo "Please provide a value for the VER variable like this:"; echo "make VER=4 build.image"; false; fi;
echo "Building docker image: $(DOCKER_MONITORING_IMAGE)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_MONITORING_IMAGE) -f monitoring/Dockerfile ./monitoring/
docker tag ${DOCKER_MONITORING_IMAGE} ${DOCKER_REGISTRY}/${DOCKER_MONITORING_IMAGE}
#build.prod: For use with ci/cd or building production image based on VERSION set in makefile.
build.prod:
echo "Building docker image: $(DOCKER_IMAGE):$(VERSION)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_IMAGE):$(VERSION) -f Dockerfile .
docker tag $(DOCKER_IMAGE) $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(VERSION)
echo "Building docker image: $(DOCKER_MONITORING_IMAGE):$(VERSION)"
docker build --platform=linux/amd64 --no-cache --pull -t $(DOCKER_MONITORING_IMAGE):$(VERSION) -f monitoring/Dockerfile ./monitoring/
docker tag $(DOCKER_MONITORING_IMAGE) $(DOCKER_REGISTRY)/$(DOCKER_MONITORING_IMAGE):$(VERSION)

publish: build
if [ -z "$(VER)" ]; then echo "Please provide a value for the VER variable like this:"; echo "make VER=4 build.image"; false; fi;
docker image push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE)
docker image push ${DOCKER_REGISTRY}/${DOCKER_MONITORING_IMAGE}
publish.dev:
docker image push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(DEV_VERSION)
docker image push $(DOCKER_REGISTRY)/$(DOCKER_MONITORING_IMAGE):$(DEV_VERSION)

build: build.image build.monitoring

clean:
rm -rf build
rm -rf node_modules
publish.prod:
docker image push $(DOCKER_REGISTRY)/$(DOCKER_IMAGE):$(VERSION)
docker image push $(DOCKER_REGISTRY)/$(DOCKER_MONITORING_IMAGE):$(VERSION)
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Appstore-Sockets
Appstore-Sockets consists of a server and monitor application. Both of these applications follow the same versioning scheme as they are reasonably coupled together.

These applications are used as part of a typical HeLx deployment enabling pod monitoring functionlity as part of the HeLx-UI sidebar and colored iconography.

The applications are packaged in [appstore-sockets-chart](https://github.com/helxplatform/appstore-sockets-chart) and integrated with [helm-charts](https://github.com/helxplatform/helm-charts) which is used for helm deployments of HeLx.

## Makefile
Makefile is used to keep track of the version of the software and consists of a few easy to use make targets for building dev and production images locally.

## CI/CD
Github Actions is used to build and create release objects as well as test images when pushing to this repository. We use tagging to ensure our version is consistent and push to docker and Renci artifact repository for pairity.
3 changes: 2 additions & 1 deletion monitoring/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM python:3.9.6-slim
FROM python:3.12.11-alpine

ENV PYTHONDONTWRITEBYTECODE 1

Check warning on line 3 in monitoring/Dockerfile

View workflow job for this annotation

GitHub Actions / build-test / test-image-build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV PYTHONUNBUFFERED 1

Check warning on line 4 in monitoring/Dockerfile

View workflow job for this annotation

GitHub Actions / build-test / test-image-build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

WORKDIR /usr/src/app
COPY . /usr/src/app

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

CMD ["python", "-u", "monitor.py"]
2 changes: 1 addition & 1 deletion monitoring/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kubernetes==22.6.0
requests==2.27.1
requests==2.32.4
pytz==2021.3
Loading