appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 65 forks source link

None of the stack initialization is working on self-hosted AppVeyor and local Docker #3179

Closed belidzs closed 4 years ago

belidzs commented 4 years ago

Build definition

build_cloud: Docker
image: Linux
stack: python 3.7
build: off
build_script:
  - python --version

Output

It produces this output:

Job started
git clone -q --branch=appveyor https://redacted/redacted.git /appveyor/projects/redacted
git checkout -qf redacted
Configuring 'stack'
Enabling Python 3.7.4
/opt/appveyor/build-agent/bash-shell.sh: line 62: /home/appveyor/venv3.7.4/bin/activate: No such file or directory
Error enabling 'python' stack: Command exited with code 1

Environment

I have a feeling that I might be missing something obvious, but I can't figure it out.

belidzs commented 4 years ago

I have tried using multiple versions of python, node and go but none of them worked.

PS C:\Users\belidzs> docker images
REPOSITORY             TAG                    IMAGE ID            CREATED             SIZE
appveyor/build-image   minimal-ubuntu-18.04   4677f476e667        5 weeks ago         687MB

PS C:\Users\belidzs> docker container ls -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
FeodorFitsner commented 4 years ago

That's because Python is not installed into that image by default. You have to tick "Python" as an option and build the image with Python based on appveyor/build-image:minimal-ubuntu-18.04.

belidzs commented 4 years ago

@FeodorFitsner thanks for getting me back so quickly.

I was under the impression that this image comes preinstalled with a lot of software (including Python variants) according to this document: https://www.appveyor.com/docs/linux-images-software/

Is this list only relevant if I use the cloud service?

Also, can you please be more specific where exactly can I tick these options on my self-hosted appveyor instance?

FeodorFitsner commented 4 years ago

Well, I understand you. It would be so natural to get a Docker image with all software pre-installed, but our concern was the size of resulting image and pushing it to Docker Hub. Right now, we all stuff pre-installed it would be around 40 GB. Moreover, what would be user experience if we you wait for hours while the image is pulled (yes, on the other hand you get empty image which is not good too).

To get the image with pre-installed software you have to go this way:

image

belidzs commented 4 years ago

Beginning with a lean system sounds very reasonable I just thought that the base image would be upgraded automatically at the beginning of each build with the stack: present. Having used the docker image generator to generate an enhanced image myself I now understand why this would be very inefficient.

The configurator on your screenshot looks very promising however it's not available on the self-hosted server. I was able to generate the following commands using the cloud service though:

Set-ExecutionPolicy Bypass -Scope CurrentUser -Force; Install-Module AppVeyorBYOC -Scope CurrentUser -Force; Import-Module AppVeyorBYOC
Connect-AppVeyorToDocker -AppVeyorUrl https://xx.com -ApiToken xx -ImageName "LinuxPython" -ImageOs "Linux" -ImageTemplate "mcr.microsoft.com/powershell:ubuntu-18.04" -ImageFeatures "install_pythons" -ImageCustomScript ""

May I suggest to include this wizard in the self-hosted version too?

Also it would be nice if the AppVeyor instance would warn the user if the environment is not suitable for the selected stack and it would suggest the use of the powershell cmdlet. The documentation is kind of spotty about this feature.

Thanks for your help, I'm gonna close this ticket because the issue has been resolved for me!

FeodorFitsner commented 4 years ago

You can, actually, try the latest version (not public yet and thus not signed) with BYOC: https://appveyordownloads.blob.core.windows.net/appveyor/7.0.2546/appveyor-server-7.0.2546-win-x64.msi

belidzs commented 4 years ago

This version works significantly better, thanks!

Previously I also had some problems running the cmdlet locally (I ended up doing what the script should have) and I also wasn't able to delete an image from the GUI. In this release everything works as it should. Cheers