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

Build and deployment process #64

Open
onlinejudge95 opened this issue Oct 11, 2024 · 4 comments
Open

Build and deployment process #64

onlinejudge95 opened this issue Oct 11, 2024 · 4 comments

Comments

@onlinejudge95
Copy link
Contributor

Can we automate the build process of this package using any CI provider?

I checked the .travis.yml file and was not able to find any build/deployment step.
I had recently merged an MR and i am not able to see the bumped version in pypi. Adding this functionality would make the package update process better.

@setnes
Copy link

setnes commented Dec 10, 2024

This might not be what you're looking for, but here's an Ansible task that installs into a Python virtual environment at /opt/indiweb/venv. This requires virtualenv to be installed on the target system. If you're using systemd to start the service, you'd have to adjust the instructions to point at the virtual environment.

A few notes on this. The most recent changes that allow this to be installed on Ubuntu 24.04 have not yet been published to PyPi (??), so that's why this is pulling directly from github. Also, ansible.builtin.pip does nothing with requirements.txt from the git source. It takes some extra magic to run that and get the desired versions for the dependencies. In this case I'm pulling requirements.txt directly from github in the extra_args parameter. I'm not entirely sure how to reference that file directly from what ansible.builtin.pip downloads with the *.git link. That gets created and destroyed as part of whatever the ansible module is doing. So that file really gets downloaded twice.

Installing into the virtual environment like this allows us to use whatever versions are required without ending up in dependency hell by trying to use whatever versions the OS has installed. It is a pain, but it also makes using this on different platforms a lot more predictable.

- name: Install INDI Web Manager
  ansible.builtin.pip:
    name: "git+https://github.com/knro/indiwebmanager.git@master"
    state: latest
    virtualenv: "/opt/indiweb/venv"
    extra_args: "-r https://raw.githubusercontent.com/knro/indiwebmanager/refs/heads/master/requirements.txt"

I'm not sure if upgrades will work automatically as there's not really a version change to watch for when pulling from git master like this.

@onlinejudge95
Copy link
Contributor Author

This is a bad strategy, A library that I am installing via pip should be versioned. Also Can you point me to a place where I can see the Build for any changes that are pushed?
Doing the push to PyPI manually is wrong at so many levels IMO.

@knro
Copy link
Owner

knro commented Dec 24, 2024

I'm open to any suggestions to automate this with Github actions. I agree with you, this should be automated. Unfortunately, I'm too busy with other projects. If you can volunteer to work on this, it would be greatly appreciated.

@setnes
Copy link

setnes commented Dec 25, 2024

Just want to be clear that I know what I'm doing isn't perfect, but it's what I had to do to get it installed. :)

I think installing to a virtual environment is a good thing, and probably best way to support different OS versions. Having to pull directly from Github instead of using the outdated version on PyPI is what wasn't ideal. Having simple instructions to do both would be helpful though. Even if the PIP/PyPI version was up-to-date, there might be times when someone would want to test a version not yet in master. The process would be the same.

I used Ansible to do this because I have an automated build script to setup my systems (super handy), but most users just need the PIP virtual environment statements to do this from the command line.

I use INDI Web Manager because it has some nice JSON APIs that are handy in my scripts. I'm glad this project exists. I don't use Ekos.

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

No branches or pull requests

3 participants