Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#12 add dockerfile, devcon.json, readme & makefile #13

Open
wants to merge 2 commits into
base: 8.1
Choose a base branch
from
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
24 changes: 24 additions & 0 deletions custom_nodes/python/.devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Starters punch X 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 Starters 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

34 changes: 34 additions & 0 deletions custom_nodes/python/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
24 changes: 24 additions & 0 deletions custom_nodes/python/.devcontainer/readme.md
Original file line number Diff line number Diff line change
@@ -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

9 changes: 9 additions & 0 deletions custom_nodes/python/Dockerfile.devCont
Original file line number Diff line number Diff line change
@@ -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

11 changes: 10 additions & 1 deletion custom_nodes/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 and develop your artifact in DevContainer. Check file documentation README.md on folder .devcontainer.
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
Expand Down
1 change: 0 additions & 1 deletion custom_nodes/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ authors = ["Punch"]

[tool.poetry.dependencies]
python = "^3.10.4"

[tool.poetry.dev-dependencies]
punch-api = "8.0.1"

Expand Down