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

Grafonnet: fix python run #644

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

ebattat
Copy link
Collaborator

@ebattat ebattat commented Aug 29, 2023

Type of change

Note: Fill x in []

  • bug
  • enhancement
  • documentation
  • dependencies

Description

Fix Python run issue by adding PYTHONPATH=. before running python script

For security reasons, all pull requests need to be approved first before running any automated CI

@ebattat ebattat added the bug Something isn't working label Aug 29, 2023
@ebattat ebattat self-assigned this Aug 29, 2023
@@ -288,7 +288,7 @@ jobs:
ELASTICSEARCH_USER: ${{ secrets.PERF_ELASTICSEARCH_USER }}
ELASTICSEARCH_PASSWORD: ${{ secrets.PERF_ELASTICSEARCH_PASSWORD }}
run: |
python "$GITHUB_WORKSPACE"/benchmark_runner/grafana/update_versions_main_libsonnet.py
PYTHONPATH=. python benchmark_runner/grafana/update_versions_main_libsonnet.py
Copy link
Member

Choose a reason for hiding this comment

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

Are you guaranteed to be chdir'd to $GITHUB_WORKSPACE at this point? If so, OK, otherwise I would add

cd "$GITHUB_WORKSPACE"

prior to this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated "$GITHUB_WORKSPACE"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@RobertKrawitz, pls let me know that its ok

@@ -288,7 +288,7 @@ jobs:
ELASTICSEARCH_USER: ${{ secrets.PERF_ELASTICSEARCH_USER }}
ELASTICSEARCH_PASSWORD: ${{ secrets.PERF_ELASTICSEARCH_PASSWORD }}
run: |
python "$GITHUB_WORKSPACE"/benchmark_runner/grafana/update_versions_main_libsonnet.py
PYTHONPATH=. python "$GITHUB_WORKSPACE"/benchmark_runner/grafana/update_versions_main_libsonnet.py
Copy link
Member

Choose a reason for hiding this comment

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

PYTHONPATH=. refers to the current directory. If you're cd'ed into /tmp, say, everything will be referenced relative to /tmp.

A better way to write it would be

cd "$GITHUB_WORKSPACE" && PYTHONPATH=. benchmark_runner/grafana/update_versions_main_libsonnet.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, fixed.

Copy link
Member

@RobertKrawitz RobertKrawitz left a comment

Choose a reason for hiding this comment

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

looks good

@ebattat ebattat merged commit b03a238 into redhat-performance:main Aug 30, 2023
4 checks passed
@ebattat ebattat changed the title fix python run Grafonnet: fix python run Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants