Skip to content

Commit

Permalink
feat: update mirror server while building docker
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh6790 committed Jun 5, 2024
1 parent 49c333a commit ea60831
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
7 changes: 5 additions & 2 deletions press/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ ENV DEBIAN_FRONTEND noninteractive
ENV OPENBLAS_NUM_THREADS 1
ENV MKL_NUM_THREADS 1

#update replace archive.ubuntu.com by sg.archive.ubuntu.com in source.list
RUN sed -i -e "s/archive\.ubuntu\.com/sg\.archive\.ubuntu\.com/" /etc/apt/sources.list
#replace archive.ubuntu.com by mirror server in source.list
{% if doc.mirror_server %}
RUN sed -i -e "s/archive.ubuntu.com/{{doc.mirror_server}}/" /etc/apt/sources.list
RUN sed -i -e "s/security.ubuntu.com/{{doc.mirror_server}}/" /etc/apt/sources.list
{% endif %}

# Install essential packages
RUN --mount=type=cache,target=/var/cache/apt apt-get update \
Expand Down
28 changes: 14 additions & 14 deletions press/playbooks/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
become_user: root
gather_facts: yes
roles:
- role: essentials
- role: user
- role: nginx
- role: agent
- role: mirror
# - role: essentials
# - role: user
# - role: nginx
# - role: agent
# - role: node_exporter
# - role: deadlock_logger
# - role: filebeat
# - role: clamav
# - role: aide
# - role: additional_process_hardening
# - role: warning_banners
# - role: auditd
# - role: sshd_hardening
# - role: pam
- role: node_exporter
- role: deadlock_logger
- role: filebeat
- role: clamav
- role: aide
- role: additional_process_hardening
- role: warning_banners
- role: auditd
- role: sshd_hardening
- role: pam
9 changes: 8 additions & 1 deletion press/press/doctype/deploy_candidate/deploy_candidate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"field_order": [
"status",
"is_remote_builder_used",
"mirror_server",
"column_break_2",
"group",
"team",
Expand Down Expand Up @@ -406,6 +407,12 @@
"fieldtype": "Int",
"label": "Retry Count",
"read_only": 1
},
{
"fieldname": "mirror_server",
"fieldtype": "Link",
"label": "Mirror Server",
"options": "Mirror Server"
}
],
"links": [
Expand All @@ -422,7 +429,7 @@
"link_fieldname": "document_name"
}
],
"modified": "2024-05-24 11:50:55.127138",
"modified": "2024-06-05 11:13:35.702377",
"modified_by": "Administrator",
"module": "Press",
"name": "Deploy Candidate",
Expand Down
1 change: 1 addition & 0 deletions press/press/doctype/deploy_candidate/deploy_candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class DeployCandidate(Document):
manually_failed: DF.Check
merge_all_rq_queues: DF.Check
merge_default_and_short_rq_queues: DF.Check
mirror_server: DF.Link | None
packages: DF.Table[DeployCandidatePackage]
pending_duration: DF.Time | None
pending_end: DF.Datetime | None
Expand Down
1 change: 1 addition & 0 deletions press/press/doctype/release_group/release_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ def create_deploy_candidate(self, apps_to_update=None) -> "Optional[DeployCandid
"dependencies": dependencies,
"packages": packages,
"environment_variables": environment_variables,
"mirror_server": self.mirror_server,
}
).insert()

Expand Down

0 comments on commit ea60831

Please sign in to comment.