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

feature: Enable Deployment from Git Repositories to Akash Network #358

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
001311a
create 23 files and update 8 files
dharamveergit Aug 16, 2024
93053db
feat: Update Remote Deploy
dharamveergit Aug 16, 2024
774ed43
update 4 files and create 2 files
dharamveergit Aug 16, 2024
2c8636d
feat: new Repo selection
dharamveergit Aug 16, 2024
1dec0b3
feat: Bitbucket Repo Selection
dharamveergit Aug 16, 2024
ab30a3b
feat: Gitlab Repo Selection
dharamveergit Aug 16, 2024
d7ef049
fix: Gitlab repos ui fix
dharamveergit Aug 16, 2024
82e25fe
feat: update disable _pull
dharamveergit Aug 16, 2024
89f5d5c
fix : update ui
dharamveergit Aug 17, 2024
5c125d5
feat: New Frameworks
dharamveergit Aug 17, 2024
6466920
feat: vite Framework
dharamveergit Aug 17, 2024
dc35ad4
fix: open fix repos
dharamveergit Aug 17, 2024
040a626
update Repos.tsx, RemoteDeployUpdate.tsx and utils.ts
dharamveergit Aug 19, 2024
d047872
fix : more git repo fetch
dharamveergit Aug 20, 2024
4fb2650
test: temp fix
dharamveergit Aug 21, 2024
0a8a3eb
fix: relogin
dharamveergit Aug 22, 2024
cf05236
feat: remote-deploy: bug fixes
dharamveergit Aug 22, 2024
a788457
fix: redeploy advanced
dharamveergit Aug 22, 2024
6805c5a
update GihubDeploy.tsx
dharamveergit Aug 23, 2024
f681b75
update 5 files
dharamveergit Aug 23, 2024
cf15e95
update RemoteDeployUpdate.tsx and templates.ts
dharamveergit Aug 24, 2024
4ec0ee1
Merge remote-tracking branch 'upstream/main'
dharamveergit Aug 26, 2024
449c4e4
update : descriptions
dharamveergit Aug 26, 2024
29591f1
fixes: type
dharamveergit Aug 28, 2024
5e5b392
fix:repo filtering
dharamveergit Aug 28, 2024
7cd8536
remove: console.logs
dharamveergit Aug 28, 2024
21973f8
fix: repo redeploy selection
dharamveergit Aug 28, 2024
933c1a4
feat: images for git accounts
dharamveergit Aug 28, 2024
41a30c6
Merge remote-tracking branch 'upstream/main'
dharamveergit Aug 29, 2024
b9239ea
fix: filtering of repo (In Github)
dharamveergit Aug 29, 2024
0d64352
fix: ui (remote deploy)
dharamveergit Aug 30, 2024
a18e288
ui fix : rollback
dharamveergit Aug 30, 2024
1d785ef
Merge remote-tracking branch 'upstream/main'
dharamveergit Aug 30, 2024
e2d66fc
update Rollback.tsx
dharamveergit Aug 30, 2024
5547af2
fix : names( Remote Deploy)
dharamveergit Aug 31, 2024
7c623b5
update LeaseRow.tsx
dharamveergit Aug 31, 2024
5491178
fix: ui issues (Remote Deploy)
dharamveergit Aug 31, 2024
895d42c
remove : service name edit form remote deploy
dharamveergit Aug 31, 2024
cbf4dd9
update Advanced.tsx and EnvFormModal.tsx
dharamveergit Sep 3, 2024
69c0366
api: github api (next)
dharamveergit Sep 5, 2024
0bdadb4
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 6, 2024
18bdf90
next api: remote deploy - gitlab,bitbucket
dharamveergit Sep 6, 2024
874145c
ui fixes : Env and account ui (Remote Deploy)
dharamveergit Sep 7, 2024
c49d5d1
fix : env in update deployment
dharamveergit Sep 7, 2024
83ec32b
fix: Account select in smaller screens (Remote Deploy)
dharamveergit Sep 7, 2024
7e0d4f8
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 7, 2024
4c1c7a0
remove: console logs (Remote Deploy)
dharamveergit Sep 7, 2024
2cd1458
update api.ts
dharamveergit Sep 7, 2024
2841b9e
Merge pull request #6 from dharamveergit/main
dharamveergit Sep 7, 2024
376bbfa
fix: auth github
dharamveergit Sep 7, 2024
86428b0
build(deps): update package-lock.json
dharamveergit Sep 7, 2024
6104d66
update authenticate.ts
dharamveergit Sep 7, 2024
65c1d49
fix : Deploy
dharamveergit Sep 7, 2024
c86d5bc
Merge pull request #7 from dharamveergit/main
dharamveergit Sep 7, 2024
1469353
fix: remove "Environment Variables" in expanded state (Remote Deploy)
dharamveergit Sep 9, 2024
01708cd
Merge pull request #8 from dharamveergit/main
dharamveergit Sep 9, 2024
b9ed85b
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 12, 2024
29c8d5a
fix: Reordering of variables and useEffects
dharamveergit Sep 12, 2024
2da9923
fix: code clean (Remote Deploy)
dharamveergit Sep 12, 2024
a693d7a
fix: type fixes (Remote Deploy)
dharamveergit Sep 12, 2024
6f38fa9
fix: types (Remote Deploy)
dharamveergit Sep 12, 2024
299fe33
update Repos.tsx, bitbucket-api.ts and gitlab-api.ts
dharamveergit Sep 12, 2024
c026375
fix: vercel deploy fix
dharamveergit Sep 12, 2024
5647200
revert: vercel deploy
dharamveergit Sep 12, 2024
bcf6b8d
Merge pull request #9 from dharamveergit/main
dharamveergit Sep 12, 2024
5821792
fix: types and api class logic (Remote Deployment)
dharamveergit Sep 13, 2024
1a2ab6b
fix: vercel deploy
dharamveergit Sep 13, 2024
c133100
Merge pull request #10 from dharamveergit/main
dharamveergit Sep 13, 2024
999660c
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 13, 2024
beebec7
Merge pull request #11 from dharamveergit/main
dharamveergit Sep 13, 2024
dfb4367
fix: fetch deploy.yml from awesome akash
dharamveergit Sep 16, 2024
166016f
Merge pull request #12 from dharamveergit/main
dharamveergit Sep 16, 2024
83a2a06
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 20, 2024
3052eca
Merge remote-tracking branch 'upstream/main'
dharamveergit Sep 20, 2024
368b22a
build(deps): update browser-env.config.ts, env-config.schema.ts and p…
dharamveergit Sep 20, 2024
cc5beed
Merge pull request #13 from dharamveergit/main
dharamveergit Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/deploy-web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const moduleExports = {
styledComponents: true
},
images: {
domains: ["raw.githubusercontent.com"]
domains: ["raw.githubusercontent.com", "avatars.githubusercontent.com"]
},
output: "standalone",
typescript: {
Expand Down
54 changes: 52 additions & 2 deletions apps/deploy-web/src/components/deployments/DeploymentDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import { createRef, useEffect, useState } from "react";
import { Alert, Button, buttonVariants, Spinner, Tabs, TabsList, TabsTrigger } from "@akashnetwork/ui/components";
import { ArrowLeft } from "iconoir-react";
import yaml from "js-yaml";
import Link from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
import { useParams, useRouter, useSearchParams } from "next/navigation";
import { NextSeo } from "next-seo";
import { event } from "nextjs-google-analytics";

Expand All @@ -16,10 +17,12 @@ import { useDeploymentLeaseList } from "@src/queries/useLeaseQuery";
import { useProviderList } from "@src/queries/useProvidersQuery";
import { RouteStep } from "@src/types/route-steps.type";
import { AnalyticsEvents } from "@src/utils/analytics";
import { deploymentData } from "@src/utils/deploymentData";
import { getDeploymentLocalData } from "@src/utils/deploymentLocalDataUtils";
import { cn } from "@src/utils/styleUtils";
import { UrlService } from "@src/utils/urlUtils";
import Layout from "../layout/Layout";
import { getRepoUrl, isRedeployImage } from "../remote-deploy/utils";
import { Title } from "../shared/Title";
import { DeploymentDetailTopBar } from "./DeploymentDetailTopBar";
import { DeploymentLeaseShell } from "./DeploymentLeaseShell";
Expand All @@ -28,7 +31,10 @@ import { DeploymentSubHeader } from "./DeploymentSubHeader";
import { LeaseRow } from "./LeaseRow";
import { ManifestUpdate } from "./ManifestUpdate";

export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: string }>) {
export function DeploymentDetail() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason of removing the props and using the useParams hook?

const dseq = (useParams()?.dseq as string) ?? "";
console.log(dseq);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️


const router = useRouter();
const [activeTab, setActiveTab] = useState("LEASES");
const { address, isWalletLoaded } = useWallet();
Expand Down Expand Up @@ -130,6 +136,41 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin
label: `Navigate tab ${value} in deployment detail`
});
};
const [remoteDeploy, setRemoteDeploy] = useState<boolean>(false);
const [repo, setRepo] = useState<string | null>(null);
const [editedManifest, setEditedManifest] = useState<string | null>(null);
const [deploymentVersion, setDeploymentVersion] = useState<string | null>(null);
const [showOutsideDeploymentMessage, setShowOutsideDeploymentMessage] = useState(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move all these variables at the top of the components with over variables.


useEffect(() => {
const init = async () => {
const localDeploymentData = getDeploymentLocalData(deployment?.dseq || "");
console.log("localDeploymentData", !!localDeploymentData && !!localDeploymentData?.manifest);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️


if (localDeploymentData && localDeploymentData.manifest) {
setShowOutsideDeploymentMessage(false);
setEditedManifest(localDeploymentData?.manifest);
const yamlVersion = yaml.load(localDeploymentData?.manifest);
const version = await deploymentData.getManifestVersion(yamlVersion);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version already exist on the deployment, why are you recomputing it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the deployment data inorder to detect the image name being used in the deployment. If the deployed image is our custom image, we are showing a different update UI to the user with additional options.


setDeploymentVersion(version);
} else {
console.log("klsj");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️


setShowOutsideDeploymentMessage(true);
}
};

init();
}, [deployment]);

useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these useEffect with the other ones at the top for better readability.

if (editedManifest && isRedeployImage(editedManifest)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need a useEffect + 2 useState variables for this.
https://react.dev/learn/you-might-not-need-an-effect

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or why not merge it with the useEffect above since this is where we set editedManifest

setRepo(getRepoUrl(editedManifest));

setRemoteDeploy(true);
}
}, [editedManifest]);

return (
<Layout isLoading={isLoadingLeases || isLoadingDeployment || isLoadingProviders} isUsingSettings isUsingWallet containerClassName="pb-0">
Expand Down Expand Up @@ -173,6 +214,13 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin

{activeTab === "EDIT" && deployment && leases && (
<ManifestUpdate
editedManifest={editedManifest as string}
deploymentVersion={deploymentVersion}
setEditedManifest={setEditedManifest}
setDeploymentVersion={setDeploymentVersion}
setShowOutsideDeploymentMessage={setShowOutsideDeploymentMessage}
showOutsideDeploymentMessage={showOutsideDeploymentMessage}
remoteDeploy={remoteDeploy}
deployment={deployment}
leases={leases}
closeManifestEditor={() => {
Expand All @@ -199,6 +247,7 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin
{leases &&
leases.map((lease, i) => (
<LeaseRow
repo={repo}
key={lease.id}
lease={lease}
setActiveTab={setActiveTab}
Expand All @@ -207,6 +256,7 @@ export function DeploymentDetail({ dseq }: React.PropsWithChildren<{ dseq: strin
dseq={dseq}
providers={providers || []}
loadDeploymentDetail={loadDeploymentDetail}
remoteDeploy={remoteDeploy}
/>
))}

Expand Down
Loading
Loading