Artifactory Questions and Answers

 

What is an artifactory?

Artifactory is a repository manager that supports all types of software packages and allows for continuous automated integration and delivery. Add Artifactory to your toolchain and use it to store build artifacts in your repository.

 

What issues does Artifactory resolve?

The public Maven repositories can become unreliable. It is expensive and inefficient for every developer inside the same organization to go and retrieve remote artifacts that are shared by nature.

There is often a need to globally enforce and control the repositories and the artifacts included in a build in terms of security, licensing, include/exclude patterns

As part of a normal build, Maven will send update queries to its public repositories, even for the organization’s internal artifacts. Such query requests going over the internet may reveal sensitive information about your ongoing projects, which the organization would like to keep private.

  • libraries will be versioned and controlled.
  • Other teams will simply need to declare a dependency in their pom to use the library.
  • Our common library is now shared.

 

What different types of JFrog Repositories are there?

JFrog repositories are divided into four categories:

Local repositories – Artifacts that you upload and manage locally are stored in local repositories.

Remote repositories – Remote repositories hold cached artifacts from public cloud repositories such as DockerHub, MVNRepository, and NPM repositories, among others.

Virtual repositories – A virtual repository is a logical repository that combines local and remote repositories.

Distribution repositories – Distribution repositories store artifacts that can be easily transferred from Artifactory to bintray and then distributed to end users.

 

Can you explain repository types available for the artifactory.

REPOSITORY TYPES Available for artifactory:

Artifactory hosts four repository types: Local, Remote, Virtual and Distribution. Local and remote repositories are true physical repositories, while a virtual repository is actually an aggregation of them used to create controlled domains for search and resolution of artifacts. Distribution repositories are a special-case for exporting data from Artifactory to JFrog Bintray.

JFrog Bintray is a universal distribution platform. It is a cloud platform that gives you full control over how you publish, store, promote, and distribute software.

As a universal distribution platform, Bintray supports all file formats and offers advanced integration with common development technologies

Snapshots are for Dev

Typically used for “throwaway” builds. I publish them from my CI server, triggered by changes committed to the source code. The purpose of the snapshot build is to share the latest tested artifact from a particular team. This is important as teams might be sharing jars between each other.

Release candidates are for QA

 

What types of artifacts can be stored in JFrog Artifactory?

JFrog Artifactory can store any type of artifact, but it is most commonly used for storing software artifacts. This could include things like compiled binaries, source code, and configuration files.

 

Is there any limit on the size of files that can be uploaded to JFrog Artifactory?

There is no limit on the size of files that can be uploaded to JFrog Artifactory.

 

Do you think it makes sense to store large binaries in JFrog Artifactory?

JFrog Artifactory is designed for storing large binaries, so it makes sense to store large binaries in Artifactory. Artifactory can handle binaries of any size, and it provides features like checksum verification and content-based search that can be useful for managing large binaries.

Explain artifactory architecture.

Artifactory High Availability (HA) :

Artifactory supports a High Availability network configuration with a cluster of 2 or more, active read/write Artifactory servers on the same Local Area Network (LAN).

Maximize Uptime, Manage Heavy Loads, Minimize Maintenance Downtime

Artifactory HA architecture presents a Load Balancer connected to a cluster of two or more Artifactory servers that share a common database where all the Artifactory configuration files are maintained.

— Load Balancer

The load balancer is the entry point to your Artifactory HA installation and optimally distributes requests to the Artifactory server nodes in your system. It is the responsibility of your organization to manage and configure it correctly.

— Artifactory Server Cluster

Each Artifactory server in the cluster receives requests routed to it by the load balancer. All servers share a common database and communicate with each other to ensure that they are synchronized on all transactions.

— Database

Artifactory HA requires an external database, which is fundamental to the management of binaries and is also used to store cluster-wide configuration files. Currently, MySQL, Oracle, MS SQL, and PostgreSQL are supported.

 

What are the different modes available for deploying JFrog?

JFrog can be deployed in either standalone mode or clustered mode. In standalone mode, JFrog will run on a single server. This is the simplest deployment option and is ideal for small teams. Clustered mode is more scalable and can be deployed on multiple servers. This is the recommended option for larger teams.

 

Which cloud platforms does JFrog support?

JFrog supports AWS, Azure, and Google Cloud Platform.

 

Is it possible to use JFrog with Amazon’s Elastic Container Service (ECS)? If yes, then how would you go about doing that?

Yes, it is possible to use JFrog with Amazon’s Elastic Container Service (ECS). You would need to set up a JFrog account and then configure your Amazon ECS account to use JFrog as its container registry.

 

What is the artifactory version being used in your organization

We are using Artifactory 7.25.7

 

In which Default Port number does Artifactory run?

8081

 

POM stands for?

Project Object Model. POM files helps to resolve/download dependent artifacts.

 

How to authenticate to artifactory

LDAP Authentication is provided by Artifactory.

Permission management systems include role-based access control, LDAP/AD integration, and API tokens.

 

How is JFrog differ from GIT hub?

In short, Git is used for source code and Artifactory is used for the binaries/packages which go with the source code.

Git does not provide the traceable, trusted path for all your artifacts necessary for an effective DevOps pipeline. Artifactory provides path (URL) for all the artifacts.

GitHub supports only six packages manager i.e.: npm, Docker, Maven, Gradle, NuGet, and RubyGems.

Artifactory is truly universal that support for 30 technologies, like above 6 + pip for Python, Go modules, Conan (for C/C++), and Cargo (for Rust).

Artifactory can also host Docker registries that are OCI compliant, and supports repositories for Helm 2 and 3.

 

Difference between jFrog Artifactory and jFrog Bintray

JFrog Artifactory and JFrog Bintray both manage binaries (and any other file type you can think of).

Artifactory is mostly meant to be used inside the organization. For managing all binaries coming in as dependencies and being produced by your build process. These can later be used by others in the org or released to Bintray.

Bintray is meant to provide a universal distribution platform for your end deliverables.

For example, the pack.rpm you want to be available for your customers to download. And also that org/pack-docker docker image.

 

How you can configure JFrog to work with Jenkins?

You can configure JFrog Artifactory to work with Jenkins by installing the Artifactory plugin. This plugin will allow you to configure your Jenkins jobs to deploy artifacts to Artifactory, and to resolve dependencies from Artifactory.

 

Artifactory integration with Gradle

Artifactory provides tight integration with Gradle. All that is needed is a simple modification of your build.gradle script file with a few configuration parameters.

Both the new and older publishing mechanisms of Gradle are supported, however some of the steps to configure the Gradle Artifactory Plugin depend on the version you are using, and these are detailed in the documentation pages.

The Gradle Artifactory Plugin can be used whether you are running builds using a CI server or running standalone builds.

 

What automation features does JFrog Repository offer?

JFrog Artifactory supports automation with three key features.

Rest APIs – Rest APIs that can be used for a variety of Artifactory tasks such as build automation, artifact deployments, and CI/CD automation tool integration.

JFrog CLI is a command-line tool for automating and optimising Artifactory tasks. Internally, JFrog CLI communicated with Artifactory via Rest APIs.

Plug-in Framework – Plug-ins that provide hooks into the Artifactory and automate tasks like task scheduling, download and upload management, and responding to new builds and artefacts, among others.

 

How are snapshot and release repositories used differently?

Snapshots are for Dev

Typically used for “throwaway” builds. I publish them from my CI server, triggered by changes committed to the source code. The purpose of the snapshot build is to deploy and test the latest code change.

Release candidates are for QA

I treat QA like a full-blown release to the customer. That’s why I prefer the term “Release Candidate”.

How release revisions are managed

I use the following numbering convention for my releases.

<major number>.<minor number>.<patch number>.<build number>

Example: 1.0.0.24

 

How can I prevent previously deployed artifacts from being overwritten?

This is easily achieved by revoking the “Delete” permission from the deploying users\groups on the target repository; the delete permission is required for both artifact removal and artifact re-deployment.

All user\group permissions are editable within the UI at Admin->Security->Permissions.

https://www.jfrog.com/confluence/display/RTF/Managing+Permissions

 

How to download the latest artifact from the Artifactory repository?

I need the latest artifact (for example, a snapshot) from a repository in Artifactory.

If you have a maven artifact with 2 snapshots

name => ‘com.acme.derp’

version => 0.1.0

repo name => ‘foo’

snapshot 1 => derp-0.1.0-20161121.183847-3.jar

snapshot 2 => derp-0.1.0-20161122.00000-0.jar

Then the full paths would be

https://artifactory.example.com/artifactory/foo/com/acme/derp/0.1.0-SNAPSHOT/derp-0.1.0-20161121.183847-3.jar

and

https://artifactory.example.com/artifactory/foo/com/acme/derp/0.1.0-SNAPSHOT/derp-0.1.0-20161122.00000-0.jar

You would fetch the latest like so:

curl https://artifactory.example.com/artifactory/foo/com/acme/derp/0.1.0-SNAPSHOT/derp-0.1.0-SNAPSHOT.jar

 

How do I remove a cached local artifact that maven fetched?

Snapshot artifacts can be force-updated by using -U option with mvn when building a project with the dependency. Maven will take the newest snapshot available of the specified version. You have to deploy the fixed snapshot artifact to the repository before. The newest snapshot is determined by the timestamp attached to the file name of the jar.

However, release versions are not updated. Once a release artifact has been downloaded and verified, you must remove it manually if you replaced it on a remote repository. Generally, you should never replace release version artifacts. Rather you should always release a new version (and possibly delete the erroneous version from the repository) and change the pom.xml files of projects which use this artifact.

mvn clean install -U

-U means force update of snapshot dependencies. Release dependencies can’t be updated this way.

 

How to stop Maven/Artifactory from keeping Snapshots with timestamps

Due to disk space considerations I’d like to only ever keep one version of any snapshot in my repository. Rather than keeping multiple versions with timestamp suffixes

You can do it from the Artifactory UI by going to Admin > Repositories > edit “libs-snapshot-local” and in the dropdown named Maven Snapshot Version Behavior change it to “Deployer”

“OR”

The simplest (and recommended) way is to use non-unique snapshots. If you must use unique snapshots, you can do this in Artifactory by specifying the <maxUniqueSnapshots> property on the <localRepository> definition in artifactory.config.xml

For example:

<localRepository>

<key>snapshots</key>

<blackedOut>false</blackedOut>

<handleReleases>false</handleReleases>

<handleSnapshots>true</handleSnapshots>

<maxUniqueSnapshots>1</maxUniqueSnapshots>

<includesPattern>**/*</includesPattern>

<snapshotVersionBehavior>non-unique</snapshotVersionBehavior>

</localRepository>

 

How do I deploy a file to Artifactory using the command line?

curl -X PUT $SERVER/$PATH/$FILE –data-binary @localfile

example :

$ curl -v –user username:password –data-binary @local-file -X PUT “http://<artifactory server >/artifactory/abc-snapshot-local/remotepath/remotefile”

 

What type of security measures does JFrog Artifactory provide?

JFrog Artifactory provides a number of security measures to protect your artifacts, including user authentication, permissions, and encryption. They also offer a number of features to help you keep your artifacts safe, including auditing, activity monitoring, and integration with a number of security tools.

 

What is your understanding of automated licensing enforcement in JFrog?

Automated licensing enforcement in JFrog Artifactory ensures that only artifacts with valid licenses are stored in the repository, and that any attempts to deploy an artifact with an invalid license are blocked. This helps to keep your repository compliant with licensing requirements and avoid any potential legal issues.

 

Why might someone choose not to use JFrog Artifactory?

While JFrog Artifactory is a very popular choice for artifact management, there are a few reasons why someone might choose not to use it. One reason might be that it is not open source, so there is a cost associated with using it. Another reason might be that it is not as widely adopted as some other options, so there might be less community support available.

 

Does Artifactory provide mirroring? How do I achieve mirroring with Artifactory?

No. Artifactory uses controlled caches of remote repositories, not mirroring.

Caches are populated lazily upon request, so it is only when Maven starts hitting it with requests that caches start to fill up with artifacts. Indexing is done completely by Jackrabbit and, unlike with mirroring, is up to date immediately. When following the standard practice of running continuous builds using a build server, the Artifactory caches would normally be repeatedly synchronized, achieving a similar effect to that of mirroring.

 

Components to setup JFrog:

Java Artifactory is Java software, so we will use Oracle Java 8 to run Artifactory.

MySQL 5.6. Artifactory comes with a built-in Derby database. It’s not a strict requirement but highly recommended to use an external database. Artifactory support MySQL, PostgreSQL, Oracle, and MSSQL Server

Nginx. Artifactory runs on top of Tomcat as an application server. We can access artifactory directly, but we will use Nginx as a reverse proxy for Tomcat / Artifactory. We will also set up SSL on Nginx, so SSL termination will happen on Nginx instead of on Tomcat.

 

Steps for Artifactory Installation

Install JAVA:

sudo yum update

sudo yum install java-1.8.0-openjdk

java -version

INSTALL MySQL:

sudo yum install wget

sudo wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm

sudo rpm -ihv mysql57-community-release-el7-7.noarch.rpm

sudo yum install -y mysql-server

-Start mysqld service

sudo systemctl start mysqld.service

sudo systemctl enable mysqld.service

sudo tail -n 200 /var/log/mysqld.log | grep pass

###### 2016-10-19T10:54:07.860478Z 1 [Note] A temporary password is generated for root@localhost: zTLvkmi5ja+<

sudo mysql -u root -p

ALTER USER ‘root’@’localhost’ IDENTIFIED BY “F4ckNySq!”;

uninstall plugin validate_password;

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘password’;

ALTER USER ‘root’@’localhost’ PASSWORD EXPIRE NEVER;

grant all on artdb.* to ‘artifactory’@’127.0.0.1’ IDENTIFIED BY ‘password’;

grant all on artdb.* to ‘artifactory’@’localhost’ IDENTIFIED BY ‘password’;

FLUSH PRIVILEGES;

INSTALL Artifactory :

sudo wget https://bintray.com/jfrog/artifactory-rpms/download_file?file_path=jfrog-artifactory-oss-4.13.2.rpm -O jfrog-artifactory-oss-4.13.2.rpm

sudo rpm -ihv jfrog-artifactory-oss-4.13.2.rpm

CONFIGURE DB Automatically

sudo /opt/jfrog/artifactory/bin/configure.mysql.sh

########################################################

# Welcome to the Artifactory MySQL configuration tool! #

########################################################

Please enter the MySQL server admin username [root]:

Please enter the MySQL server admin password:

Please enter the Artifactory database username [artifactory]:

Please enter the Artifactory database password [password]:

Creating the Artifactory MySQL user and database…

mysql: [Warning] Using a password on the command line interface can be insecure.

mysql: [Warning] Using a password on the command line interface can be insecure.

Found existing MySQL JDBC connector [mysql-connector-java-5.1.40-bin.jar].

Do you want to change it? [y/N]N

Configuration completed successfully!

You can now start up the Artifactory service to use Artifactory with MySQL.

Press enter to exit…

START

sudo service artifactory restart

userid- artifactory / password- password (if you have not installed tomcat)

userid- admin / password- password (if you have installed tomcat with above mentioned steps)

ACCESS Artifactory IP_OF_THE_SERVER:8081

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *