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

[Question]: self hosted agents #4933

Open
1 of 4 tasks
rrichardsisat opened this issue Aug 7, 2024 · 5 comments
Open
1 of 4 tasks

[Question]: self hosted agents #4933

rrichardsisat opened this issue Aug 7, 2024 · 5 comments

Comments

@rrichardsisat
Copy link

Describe your question

I am working on a project that uses Devops Server (version 2020). I keep having an issue where a self-hosted agent doesnt appear to be configured or fails to pull the code from an azure repo. Are there are detailed documents that explain the configuration or any setup steps? Also what is the difference between agents for the pipeline and the environments?

Versions

Azure devops server 2020

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Operation system

Linux

Version controll system

Azure Repos

Azure DevOps Server Version (if applicable)

2020

@vmapetr
Copy link
Contributor

vmapetr commented Aug 8, 2024

Hi @rrichardsisat thank you for your question!
Please check the following documentation to learn about the Linux self hosted agent configuration - https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/linux-agent?view=azure-devops

what is the difference between agents for the pipeline and the environments?

Environments represent a collection of resources such as namespaces within Kubernetes clusters, Azure Web Apps, virtual machines, databases, which represent some type of physical environment - "Dev", "Stage", "Prod", etc..
Default Pipelines and Environments both use the same agent software to provide communication between the host machine and the Azure DevOps server, but the Environments are logically separated group of agents that may be used for more complex deployments.
Basically, the Pipeline with agent pools is used when you need to run a build/deployment on the single machine, and the Environments is used when you need to execute the complex deployment job on the several resources at the same time.

Please check this documentation for more information about the environments - https://learn.microsoft.com/en-us/azure/devops/pipelines/process/environments?view=azure-devops

@rrichardsisat
Copy link
Author

@vmapetr thank you for the information: however there seems to be an issue with the agent. Allow me to explain:

  • You can add an agent from the pipeline agent pool page
  • You can also add an 'agent' from the new environment page when you add a virtual machine resource (for example)
  • In the docks they call these folders 'myagent' and 'azagent'' respectively. These are actually the same? If they are how do you configure an existing agent that was configured for a pipeline to work as an environment agent? Perhaps this is missing in the documentation?

I noticed this issue when i deployed to an environment i created separately then deployed to this environment. I received an error "No such file" in azagent/_work/1/s. I manually placed code in this folder as a test and it worked fine. Why is the agent not cloning the codebase here automatically?

thanks for any help. I wanted to make sure its not because we are using an older version (2020) of devops server.

In the folder azagent/_work/1/s which was created from the environments page

@rrichardsisat
Copy link
Author

And i forgot to mention at first i was using version 2 of the agent but from my latest test i am using version 3 for the environment.

@rrichardsisat
Copy link
Author

rrichardsisat commented Aug 8, 2024

Here is a post that is very close to my issue but i did not see any errors in the logs: https://stackoverflow.com/questions/76718579/azure-devops-pipeline-with-self-hosted-agent-fails-at-git-checkout-step-while-sa

I fixed this by cloning the repo elsewhere and copying the path over to the _work/1/s folder but i dont think this will hold.

@rrichardsisat
Copy link
Author

Also i manually setup a pipeline agent AND an environment agent. Doesnt seem like this is how it should be. However the pipeline works as expected. I want to correct this.

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

No branches or pull requests

2 participants