diff --git a/custom_nodes/python/.devcontainer/devcontainer.json b/custom_nodes/python/.devcontainer/devcontainer.json new file mode 100644 index 0000000..bda7473 --- /dev/null +++ b/custom_nodes/python/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "../Dockerfile.devCont" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.makefile-tools", + "ms-python.python" + ] + } + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" +} diff --git a/custom_nodes/python/.devcontainer/readme.md b/custom_nodes/python/.devcontainer/readme.md new file mode 100644 index 0000000..faaf79c --- /dev/null +++ b/custom_nodes/python/.devcontainer/readme.md @@ -0,0 +1,24 @@ +# Py-punch Dev Container + +## Table of Contents +- [Introduction](#introduction) +- [Prerequisites](#prerequisites) +- [Getting Started](#getting-started) + +## Introduction +This repository contains the configuration for a development container that is pre-configured with the necessary tools and dependencies for working on the Py-punch project. Using a development container helps maintain a consistent and reproducible development environment for contributors. + +## Prerequisites +Before you begin, ensure you have met the following requirements: +- [Docker](https://www.docker.com/get-started) installed on your system. +- [Visual Studio Code](https://code.visualstudio.com/) with the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. + +## Getting Started +To get started with the development container, follow these steps: + +1. Once the extension is present, simply do "CTRL+shift+p". +2. Enter "Dev Containers: Reopen in Container". +3. Develop your specific nodes. +4. Create your punchline that allows you to test the previously written code. +5. Use command make run-dev + diff --git a/custom_nodes/python/Dockerfile.devCont b/custom_nodes/python/Dockerfile.devCont new file mode 100644 index 0000000..f06166f --- /dev/null +++ b/custom_nodes/python/Dockerfile.devCont @@ -0,0 +1,9 @@ +# Build +FROM ghcr.io/punchplatform/punchline-python:8.1-dev +USER root +RUN apt-get update && apt-get install -y --no-install-recommends make && apt-get -y install sudo && apt-get -y install git && apt-get -y install gettext-base && apt-get -y install zip +#RUN useradd --create-home punch +ARG VERSION +ARG POETRY_USERNAME +ARG POETRY_PASSWORD + diff --git a/custom_nodes/python/Makefile b/custom_nodes/python/Makefile index 8347f3e..7a96e87 100644 --- a/custom_nodes/python/Makefile +++ b/custom_nodes/python/Makefile @@ -57,12 +57,21 @@ clean: ## Clean this repository .PHONY: run -run: ## Test your artifact with java engine using docker +run: ## Test your artifact with python engine using docker docker run --rm -it \ -v $(OUTPUT_FILE):/usr/share/punch/$(DEPENDENCY_LOCATION) \ -v $(CURDIR)/test/punchline.yaml:/data/punchline.yaml \ $(PUNCHLINE_IMG) /data/punchline.yaml + +.PHONY: run-dev + +run-dev: build ## Test your artifact with python engine using docker + mkdir -p /usr/share/punch/extlib/ + cp $(OUTPUT_FILE) /usr/share/punch/$(DEPENDENCY_LOCATION) + cp $(CURDIR)/test/punchline.yaml /data/punchline.yaml + bash /start.sh /workspaces/starters/custom_nodes/python/test/punchline.yaml + .PHONY: upload upload: ## Upload artifact to artifact server