From a535ebfd9c88ea7d085c418ca2e1993618516f8e Mon Sep 17 00:00:00 2001 From: Shea Stewart Date: Wed, 6 Nov 2024 17:05:12 -0500 Subject: [PATCH] Fix/packaging (#20) * oh the changes we are a testing * packaging updates * tune up some permissions * revert devcontainer from local test --------- Co-authored-by: stewartshea <> --- Dockerfile | 20 +++++++++++++------- VERSION | 2 +- requirements.txt | 7 ++++--- setup.py | 13 +++++-------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a16ec2..def1045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,18 @@ ARG BASE_IMAGE=us-docker.pkg.dev/runwhen-nonprod-shared/public-images/robot-runtime-base-image:latest FROM ${BASE_IMAGE} -ENV ROBOT_LOG_DIR /robot_logs ENV RUNWHEN_HOME=/home/runwhen +ENV ROBOT_LOG_DIR=/robot_logs USER root # Set up specific RunWhen Home Dir and Permissions WORKDIR $RUNWHEN_HOME +# Ensure `runwhen` user has a fixed UID and GID (1000) +RUN usermod -u 1000 runwhen && \ + groupmod -g 1000 runwhen + # Install additional packages RUN apt-get update && \ apt-get install -y --no-install-recommends sudo && \ @@ -24,14 +28,15 @@ RUN wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform #Install go-task RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin -# Set Log Output Dir -RUN mkdir -p $ROBOT_LOG_DIR -RUN chown -R runwhen:0 $ROBOT_LOG_DIR +# Create the Log Output Directory as root, then change ownership to `runwhen` +RUN mkdir -p $ROBOT_LOG_DIR && \ + chown runwhen:0 $ROBOT_LOG_DIR && \ + chmod 775 $ROBOT_LOG_DIR # Set up dev scaffolding -COPY --chown=runwhen:0 dev_facade dev_facade +# COPY --chown=runwhen:0 dev_facade dev_facade COPY --chown=runwhen:0 auth auth -COPY --chown=runwhen:0 .pylintrc.google LICENSE ro . +COPY --chown=runwhen:0 .pylintrc.google LICENSE ro requirements.txt . # Add runwhen user to sudoers with no password prompt @@ -43,8 +48,9 @@ USER runwhen # Set the PATH to include binaries the `runwhen` user will need ENV PATH "$PATH:/usr/local/bin:/home/runwhen/.local/bin:$RUNWHEN_HOME" + #Requirements for runrobot.py and the core and User RW libs: -RUN pip install --user --no-cache-dir -r https://raw.githubusercontent.com/runwhen-contrib/codecollection-template/main/requirements.txt +RUN pip install --user --no-cache-dir -r requirements.txt RUN chmod -R g+w ${RUNWHEN_HOME} && \ chmod -R 0775 $RUNWHEN_HOME diff --git a/VERSION b/VERSION index 7bcd0e3..6812f81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.2 \ No newline at end of file +0.0.3 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c8b8237..9785395 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ robotframework>=4.1.2 jmespath>=1.0.1 python-dateutil>=2.9.0 requests>=2.31.0 -thefuzz==0.20.0 -pyyaml==6.0.1 -jinja2==3.1.4 \ No newline at end of file +thefuzz>=0.20.0 +pyyaml>=6.0.1 +jinja2>=3.1.4 +rw-devtools>=0.0.2 \ No newline at end of file diff --git a/setup.py b/setup.py index 42c2751..5870f3b 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,18 @@ -from setuptools import setup, find_packages - -with open("requirements.txt") as f: - required = f.read().splitlines() +from setuptools import setup setup( name="rw-devtools", version=open("VERSION").read().strip(), - packages=find_packages(where="dev_facade"), - package_dir={"": "dev_facade"}, + packages=["RW"], # Explicitly list the `RW` package + package_dir={"RW": "dev_facade/RW"}, # Map `RW` to its directory license="Apache License 2.0", description="A set of RunWhen Developer keywords and python libraries for local development", long_description=open("README.md").read(), long_description_content_type="text/markdown", author="RunWhen", author_email="info@runwhen.com", - url="https://github.com/runwhen-contrib/rw-cli-codecollection", - install_requires=required, + url="https://github.com/runwhen-contrib/codecollection-devtools", + install_requires=open("requirements.txt").read().splitlines(), include_package_data=True, classifiers=[ "Programming Language :: Python :: 3",