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

Dev Knowledge Base Nektos-ACT Documentation fixes issue #723 #730

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

JustKuzya
Copy link
Collaborator

@JustKuzya JustKuzya commented Jan 30, 2025

Fixes issue #723

@JustKuzya JustKuzya changed the title Dev Knowledge Base Nektos-ACT Documentation fixes issue #724 Dev Knowledge Base Nektos-ACT Documentation fixes issue #723 Jan 30, 2025
@keithmanville keithmanville requested a review from hbooth February 6, 2025 18:42
@JustKuzya
Copy link
Collaborator Author

The latest changes should fix #731 as well

@keithmanville
Copy link
Collaborator

I tried following the instructions and created my-env1.cfg with the following contents:

### Env Variable for GitHub Branch
DIOPTRA_BRANCH=dev
### Env Variable for Deployment Path
DIOPTRA_DEPLOY=~/dev/dioptra-deploy
### Env Variable for Source Path
DIOPTRA_CODE=~/dev/dioptra

Then ran source ./dev-env+.sh -e ./my-env1.cfg

I'm using zsh, so the first thing I encountered was:

❌❌❌ BASH is required to run this script ❌❌❌

I opened a bash shell and tried again and got:

Number of arguments: 2
Argument 0: bash
Argument 1: -e

 -e - ./my-env1.cfgReading config file: ./my-env1.cfg
bash: ${key^^}: bad substitution


❌❌❌ !!!Failed to set up environment configuration!!! ❌❌❌


The following Parameters were expected:
DIOPTRA_BRANCH=
DIOPTRA_DEPLOY=
DIOPTRA_CODE=
DIOPTRA_ENV_FILE=./my-env1.cfg
You can use 'env | sort' or 'printenv' command to view the rest of the environment variables

I noticed the run-X.sh scripts use #!/opt/homebrew/bin/bash which is mac and configuration specific. Since I don't have this on my system running these scripts fails.

I thought this was to set up a development environment, so needing to specify a deploy location was confusing to me.

I was able to get things working with the dev-env.sh script after modifying the config variables. But now I need to edit a file tracked by git to get my dev setup going.

The way I've been working locally is to have an env file that I source before running any of the dioptra services. These are the main items I found I needed to configure and I found having everything in a single env file for editing to be more straightforward.

export DIOPTRA_RESTAPI_DEV_DATABASE_URI="sqlite:////Users/kmanville/dev/dioptra/dioptra-dev.db"
export DIOPTRA_RESTAPI_ENV=dev
export DIOPTRA_WORKER_USERNAME="dioptra-worker"
export DIOPTRA_WORKER_PASSWORD="password"
export DIOPTRA_API="http://localhost:5173"
export RQ_REDIS_URI="redis://localhost:6379/0"
export MLFLOW_S3_ENDPOINT_URL="http://localhost:35000"
export MLFLOW_TRACKING_URI="http://localhost:35000"
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

How should we guide developers between the existing DEVELOPER.md and these knowledge base docs and scripts?

@JustKuzya
Copy link
Collaborator Author

JustKuzya commented Feb 14, 2025 via email

Copy link
Collaborator

@hbooth hbooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make changes as needed

@@ -0,0 +1,206 @@
#!/opt/homebrew/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work on all systems does /bin/bash work for macs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, /bin/bash exists on mac and works for me. I think the more robust shebang is #!/usr/bin/env bash which should find bash as long as it's in your path somewhere.

git_branch=dev
dir_work=~/dio/dio2-wrk
dir_source=~/dio/dio2-src
```
Copy link
Collaborator

@hbooth hbooth Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have alternative names? I think having just one way of doing this will make it easier to support the scripts over time as well debug when problems arise.


3. #### In the shell environment sourced in the steps 1 and 2 or only 2, run the setup script:
```
./stup.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup.sh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unnecessary given this example exists in the README.md. Would prefer to only have one place where this exists to avoid things getting out of synch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change should not be here. looks like you need pull/update PR

## <a id="act-verify"> To verify success of the ACT installation you can run any of the following commands</a>:
- ### <a id="act-version">List current ACT version</a>:
```sh
act --version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on linux it installs into

`pwd`/bin/act

so command to run would be something like ./bin/act --version

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest adding something to add act to path or create a soft ln to act from directory already in path (I did the latter)

@@ -0,0 +1,123 @@
# Nektos-ACT Use Guide
### This guide describes necessary steps to use of Nektos-ACT for developing, debugging, and running github actions locally

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need a note somewhere around here to remind that docker is necessary to be installed and the docker service running

export DOCKER_CERT_PATH=$(docker context inspect --format '{{.Storage.TLSPath}}')/docker
```

<!--
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still needed? seems redundant to earlier

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just in case certificates are desired or a dev machine has strong security access policy for container(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Developer Knowledge Base and add Description of Nektos-ACT
3 participants